[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTP/1.1 400 Bad Request



   You should post the debug log, making sure to strip out user IDs and
   passwords.
   But generally speaking, a 400 Bad Request means you didn't send your
   request correctly.
   Does the web service you are trying to call have a WSDL that provides a
   definition of how to use the service?
   Charles

   On Mon, Apr 1, 2013 at 2:27 PM, Mauricio Diaz-Lapham
   <[1]MDiaz-Lapham@xxxxxxxxxxx> wrote:

        Hello, Can someone help me! I keep getting this error and I have
     no
        clue as to what is causing it. Below is my code.
        H DFTACTGRP(*NO) BNDDIR('HTTPAPI':'QC2LE')
        d Setup           pr
        d WebService      pr            10i 0
        D Incoming        PR
        d   ProcessJrn                 100A
        D   depth                       10I 0 value
        D   name                      1024A   varying const
        D   path                     24576A   varying const
        D   value                    65535A   varying const
        D   attrs                         *   dim(32767)
        D                                     const options(*varsize)
        d ARWBSRV01       pi
        d  ErrMsg                     1024a   varying

     *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
     *=

     c*==================================================================
     ==
        c* Copybooks

     c*==================================================================
     ==
         /copy config_h
         /copy httpapi_h
        d Soap            s
        32767a
        d ProcessJrn      s            100a
        d ReturnCode      s             10i 0
        d WebSite         s            100a
        D soapfile        s             50a   varying
        dVariableRecords...
        d                 ds                  Qualified
        d Number                        10i 0

     c*==================================================================
     ==
        c* Main

     c*==================================================================
     ==
         /free
             Setup();
        /end-free

     ********************************************************************
     **
        * Main processing - Call the Webservice to update CMA

     ********************************************************************
     **
        /Free
             // Call the web service that will update the client smart
     file.
             ReturnCode = WebService();
             If ReturnCode <> 1;
                ErrMsg = http_error();
                ReturnCode = -1;
             EndIf;
          /end-free

     c*==================================================================
     ==
        c* Setup();
        c*
        c* General setup.

     c*==================================================================
     ==
        p Setup           b
         /free
          VariableRecords.Number = 4; // Number of keys.
          // Turn HTTP debug on or off
          http_debug(*ON);
          // Set the correct CCSID.
          http_setCCSIDs(1208:0);
          // Strip off back end CRLFs on the returned XMLs.
          http_XmlStripCRLF(*ON);
         /end-free
        p Setup           e

     c*==================================================================
     ==
        c* WebService(); Call The Web Service.

     c*==================================================================
     ==
        p WebService      b
        d WebService      pi            10i 0
         /free
           Soap =
           '<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>'
              +' <soapenv:Envelope '
              +  '
     xmlns:soapenv="[2]http://schemas.xmlsoap.org/soap/envelope/"; '
              +  '
     xmlns:upd="[3]http://webservices.vonmaur.vmc/UpdateCMA.asmx";>'
              +   '   <soapenv:Header/>'
              +   '   <soapenv:Body>'
              +   '      <upd:ProcessJournal/>'
              +   '   </soapenv:Body>'
              + '</soapenv:Envelope>';
          // Consume the web service.
          ReturnCode = http_url_post_xml(
            '[4]http://webservices.vonmaur.vmc/UpdateCMA.asmx'
            : %addr(SOAP) + 2
            : %len(SOAP)
            : *NULL
            : %paddr(Incoming)
            : %addr(ProcessJrn)
            :
        HTTP_TIMEOUT
            : HTTP_USERAGENT
            : 'text/xml'
            :
     '[5]http://webservices.vonmaur.vmc/UpdateCMA/ProcessJournal');
          return ReturnCode;
         /end-free
        p WebService      e

     c*==================================================================
     ==
        c* Incoming1();
        c* Parse the XML coming in to see what the client ID we received
     is.

     c*==================================================================
     ==
        p Incoming        B
        d Incoming        PI
        d   ProcessJrn                 100a
        d   depth                       10i 0 value
        d   name                      1024a   varying const
        d   path                     24576a   varying const
        d   value                    65535a   varying const
        d   attrs                         *   dim(32767)
        d                                     const options(*varsize)
        D atof            PR             8F   extproc('atof')
        D   string                        *   value options(*string)
         /free
          if (name = 'ProcessJournal');
           ProcessJrn = value;
          endif;
         /end-free
        p Incoming        E
     --------------------------------------------------------------------
     ---
     This is the FTPAPI mailing list.  To unsubscribe, please go to:
     [6]http://www.scottklement.com/mailman/listinfo/ftpapi
     --------------------------------------------------------------------
     ---

References

   1. mailto:MDiaz-Lapham@xxxxxxxxxxx
   2. http://schemas.xmlsoap.org/soap/envelope/
   3. http://webservices.vonmaur.vmc/UpdateCMA.asmx
   4. http://webservices.vonmaur.vmc/UpdateCMA.asmx
   5. http://webservices.vonmaur.vmc/UpdateCMA/ProcessJournal'
   6. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------