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

Correct code?



   I'm not sure if this is correct, I keep getting HTTP500 errors, the
   service is on a local network server (birsvr06), here is the XML for
   the SOAP calls:

POST /webservice/priceservice.asmx HTTP/1.1
Host: birsvr06
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://birsvr06/webservice/barcode";

<?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>
    <barcode xmlns="http://birsvr06/webservice";>
      <barcode>string</barcode>
    </barcode>
  </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>
    <barcodeResponse xmlns="http://birsvr06/webservice";>
      <barcodeResult>
        <product>
          <brndcd>string</brndcd>
          <pgroup>string</pgroup>
          <colcde>string</colcde>
          <sizcde>string</sizcde>
          <description>string</description>
          <colour>string</colour>
          <size>string</size>
          <message>string</message>
        </product>
        <product>
          <brndcd>string</brndcd>
          <pgroup>string</pgroup>
          <colcde>string</colcde>
          <sizcde>string</sizcde>
          <description>string</description>
          <colour>string</colour>
          <size>string</size>
          <message>string</message>
        </product>
      </barcodeResult>
    </barcodeResponse>
  </soap:Body>
</soap:Envelope>

   And here is the current program i'm trying to get it to work with:

   H DFTACTGRP(*NO) BNDDIR('HTTPAPI':'QC2LE')

   D SAPTEST1        PR                  ExtPgm('SAPTEST1')
   D   rBarcode                    13A   const
   D SAPTEST1        PI
   D   rBarcode                    13A   const

    /copy httpapi_h

   D Incoming        PR
   D   Result                   32767A   varying
   D   depth                       10I 0 value
   D   name                      1024A   varying const
   D   path                     24576A   varying const
   D   value                    32767A   varying const
   D   attrs                         *   dim(32767)
   D                                     const options(*varsize)
   D SOAP            s          32767A   varying
   D rc              s             10I 0
   D rbarcode        s             13A
   D Result          s          32767A   varying

    /free
     if ( %parms < 1 );
        http_comp('Please pass the barcode you wish to convert');
        return;
     endif;

     SOAP =
      '<?xml version="1.0" encoding="utf-8"?>'
     +'<SOAP-ENV:Envelope'
     +'    xmlns:xsi="[1]http://www.w3.org/2001/XMLSchema-instance";'
     +'    xmlns:xsd="[2]http://www.w3.org/2001/XMLSchema";'
     +'    xmlns:soap="[3]http://schemas.xmlsoap.org/soap/envelope/";'
     +'>'
     +'<SOAP-ENV:Body>'
     +'  <barcode xmlns="[4]http://birsvr06/webservice";>'
     +'     <barcode>'+ %trim(rBarcode) +'</barcode>'
     +'  </barcode>'
     +'</SOAP-ENV:Body>'
     +'</SOAP-ENV:Envelope>';

     http_debug(*ON);

     rc = http_url_post_xml(
                'http://birsvr06/webservice/priceservice.asmx'
                       : %addr(SOAP) + 2
                       : %len(SOAP)
                       : *NULL
                       : %paddr(Incoming)
                       : %addr(Result)
                       : HTTP_TIMEOUT
                       : HTTP_USERAGENT
                       : 'text/xml'
                       : 'http://birsvr06/webservice');

     if (rc <> 1);
        http_crash();
     else;
        Result = 'Product code details';
        http_comp(%trim(brndcd) + %trim(pgroup) + %trim(colcde)
                  + %trim(sizcde));
     endif;

     *inlr = *on;

    /end-free
   P Incoming        B
   D Incoming        PI
   D   Result                   32767A   varying
   D   depth                       10I 0 value
   D   name                      1024A   varying const
   D   path                     24576A   varying const
   D   value                    32767A   varying const
   D   attrs                         *   dim(32767)
   D                                     const options(*varsize)

   P                 E



   Any ideas?

   Chris Renton
   Business Systems Developer
   Sigmakalon
   Ext 4213

   Official Sponsors of the Johnstone's Paint Trophy - Bringing Colour to
   the Beautiful Game
   [5]www.johnstones-paints.co.uk/johnstonespainttrophy

   **************************************
   -----------------------------------------
   SigmaKalon UK Limited, registered in England (number 00436135), with
   its registered office at Huddersfield Road, Birstall, Batley, West
   Yorkshire, WF17 9XA. 

   PRIVATE AND CONFIDENTIAL
   This Email may contain information that is privileged, confidential or
   otherwise protected from disclosure.  It must not be used by, or its
   contents copied or disclosed to persons other than the addressee(s).
   If you have received this Email in error please notify our systems
   administrator on +44 (0)1924 354827 and delete the Email.
   WARNING
   It is the responsibility of the recipient to ensure that the onward
   transmission, opening or use of this message and any attachments will
   not adversely affect its systems or data. Please carry out such virus
   and other checks as you consider appropriate. No responsibility is
   accepted by SigmaKalon UK Limited in this regard
   The contents of this e-mail may not necessarily represent the views or
   policies of SigmaKalon UK Limited.
   No contracts may be concluded on behalf of SigmaKalon UK Limited by
   means of email communication.
   SigmaKalon UK Limited may monitor the content of e-mails, as
   appropriate, to ensure its policies and procedures are being upheld by
   its employees.  
   ----------------------------------------
   **************************************
   

References

   1. http://www.w3.org/2001/XMLSchema-instance";'
   2. http://www.w3.org/2001/XMLSchema";'
   3. http://schemas.xmlsoap.org/soap/envelope/";'
   4. http://195.99.128.7/webservice";>'
   5. http://www.johnstones-paints.co.uk/johnstonespainttrophy
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------