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

HTTP/1.1 500 Internal Server Error



   Hi Everybody,

   I figured out my previous problem. But I am getting an error at
   something else.

   Here is the  SOAP given by the  webservice company on which I need to
   program my xml

   ---------------------------

   The following is a sample SOAP request and response. The placeholders
   shown need to be replaced with actual values.
POST /webservices/abaexpress/ABAService.asmx HTTP/1.1
Host: www.lyonsreg.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.lyonsreg.com/WebService/ABAService/Logon";

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"; xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/">
  <soap:Body>
    <Logon xmlns="http://www.lyonsreg.com/WebService/ABAService";>
      <companyID>int</companyID>
      <userName>string</userName>
      <password>string</password>
    </Logon>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"; xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/">
  <soap:Body>
    <LogonResponse xmlns="http://www.lyonsreg.com/WebService/ABAService";>
      <LogonResult>string</LogonResult>
    </LogonResponse>
  </soap:Body>
</soap:Envelope>
-------------------
HEre is the error I am getting
-------------
<soap:Envelope xmlns:soap="[1]http://schemas.xmlsoap.org/soap/envelope/"; xmlns:
xsi=
  <soap:Body>

    <soap:Fault>

      <faultcode>soap:Client</faultcode>

      <faultstring>Server did not recognize the value of HTTP Header SOAPAction
:: [2]http://www.lyonsreg.com/WebService/ABAService/Logon, [3]http://www.lyonsr
eg.com/WebService/ABAService/GetBanksXML_W3C. </faultstring>
      <detail />

    </soap:Fault>

  </soap:Body>

</soap:Envelope>

SetError() #13: HTTP/1.1 500 Internal Server Error.

http_close(): entered

My piece of code is attached. Any poitners??



   Thanks



   Vikas Mishra

References

   1. http://schemas.xmlsoap.org/soap/envelope/
   2. http://www.lyonsreg.com/WebService/ABAService/Logon
   3. http://www.lyonsreg.com/WebService/ABAService/GetBanksXML_W3C
      *MODULE
      *
      **********
      * Echo Service Company
      *  This logs on to Lyons webserver
      *
      *  To Compile (requires V5R1):
      *     CRTBNDRPG PGM(WWW9112R1) SRCFILE(libhttp/QRPGLESRC)
      *
      *
     H*DFTACTGRP(*NO) BNDDIR('HTTPAPI':'QC2LE')

     D WWW9114         PR                  ExtPgm('WWW9114')
     D   Cmpid                       10  0 const
     D   usrname                     15A   const
     D   passwd                      15A   const
     D   tokensr                   1024A   varying
     D WWW9114         PI
     D   Cmpid                       10  0 const
     D   usrname                     15A   const
     D   passwd                      15A   const
     D   tokensr                   1024A   varying

      /copy httpapi_h

     D Incoming        PR
     D   String                   32767A   varying
     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 Add_SOAPACTION  PR
     D   Header                    1024A   varying
     D   UserData                      *   value

     D SOAP            s          32767A   varying
     D rc              s             10I 0
     D compid          s             10I 0
     D Result          s             12P 2
     D String          s          32767A   varying

      /free
              compid=cmpid  ;
       //       http_XmlStripCRLF(*ON);

       SOAP =
        '<?xml version="1.0" encoding="utf-8" standalone="no"?>'
       +'<SOAP:Envelope'
       +'    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";'
       +'    xmlns:xsd="http://www.w3.org/2001/XMLSchema";'
       +'    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";'
       +'    xmlns:tns="http://www.lyonsreg.com/WebService/ABAService";>'
       +'<SOAP:Body>'
       +'     <tns:Logon>'
       +'      <tns:companyID>'+ %trim(%char(Compid)) +'</tns:companyID>'
       +'      <tns:userName>'+ %trim(usrname) +'</tns:userName>'
       +'      <tns:password>'+ %trim(passwd)  +'</tns:password>'
       +'      </tns:Logon>'
       +'</SOAP:Body>'
       +'</SOAP:Envelope>';

       // HTTP_setCCSIDs(1208: 0);  // CCSID 1208 = UTF-8


       //  This tells HTTPAPI to call our subprocedure (in this example,
       //  the subprocedure is name ADD_SOAPACTION) when assembling the
       //  HTTP headers to send to the remote server.

        //  http_xproc( HTTP_POINT_ADDL_HEADER
        //         : %paddr(Add_SOAPACTION) );

       http_debug(*ON);

       rc = http_url_post_xml(
       'http://www.lyonsreg.com/webservices/abaexpress/ABAService.asmx'
                         : %addr(SOAP) + 2
                         : %len(SOAP)
                         : *NULL
                         : %paddr(Incoming)
                         : %addr(String)
                         : HTTP_TIMEOUT
                         : HTTP_USERAGENT
                         : 'text/xml'
                :'http://www.lyonsreg.com/WebService/ABAService/Logon') ;

       if (rc <> 1);
          http_crash();
       else;

       //  http_comp(String);
       tokensr=%trim(String)  ;
       http_comp(%trim(tokensr)) ;
       return;
       endif;

       *inlr = *on;

      /end-free

     P Incoming        B
     D Incoming        PI
     D   String                   32767A   varying
     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)

      /free
          if (name = 'LogonResult') ;
                 String = value;
          endif;
      /end-free
     P                 E

      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      * HTTPAPI will call this (because we set it with http_xproc)
      * just before sending the HTTP headers to the remote server.
      * This procedure lets us add any header we like to the
      * HTTP request.
      *
      * In this example, I'll use it to supply the SoapAction:
      * header.  This way, I can supply a SOAPAction that's up to
      * 1024 characters long.
      *
      * NOTE: Make sure you leave off the SOAPAction header on the
      *       HTTP_url_post_xml, above, otherwise you'll send two
      *       of them!
      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     P Add_SOAPACTION  B
     D Add_SOAPACTION  PI
     D   Header                    1024A   varying
     D   UserData                      *   value
      /free
         Header = 'SOAPAction: '
              + 'http://www.lyonsreg.com/WebService/ABAService/Logon'
                + x'0d25';
      /end-free
     P                 E

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------