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

Soap message with xml as string



   Hi,



   first of all.....Scott..thanks for nice work on httpapi!

   Httpapi with expat is working great!



   I'm communicating to a number of webservices and there is a problem
   with one of them.



   Its a webservice with 3 arguments where one is the dataxml which is
   type string.

   The dataxml tag is holding more xml data.



   The question is how to build the Soap variable in http_url_post_xml?



   Here is the webservice description:

POST /NaturKoordWebService/NPService.asmx HTTP/1.1
Host: naturskadekoordinering.no
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://naturskadekoordinering.no/NaturKoordWebService/SendMelding
er"

<?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>
    <SendMeldinger xmlns="https://naturskadekoordinering.no/NaturKoordWebServic
e/">
      <dataxml>string</dataxml>
      <selskapskode>int</selskapskode>
      <passord>string</passord>
    </SendMeldinger>
  </soap:Body>
</soap:Envelope>

   Here is some of the rpg code:



   SOAP =
   '<?xml version="1.0" encoding="utf-8"?>'
   +'<soap: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:Body>'
   +'<SendMeldinger'
   +'xmlns="[4]https://naturskadekoordinering.no/NaturKoordWebService/";>'
   +'<dataxml>'

   +'<SkadeData>'                      

   +'<Nummer>0001006</Nummer>'
   +'<HendelseNummer>0000001</HendelseNummer>'
   +'<ForsSelskapRekvAv>nnnnnnnn</ForsSelskapRekvAv>'

   +'<SkadeDato>2005-05-06</SkadeDato>'   

   +'</SkadeData>'

   +'</dataxml>'

   +'<selskapskode>xx</selskapskode>'
   +'<passord>xxxxxxx</passord>'
   +'</SendMeldinger>'
   +'</soap:Body>'
   +'</soap:Envelope>';



   http_xproc( HTTP_POINT_ADDL_HEADER
             : %paddr(Add_SOAPACTION) );

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

   rc = http_url_post_xml(
   'https://naturskadekoordinering.no/NaturKoordWebService/'
   +'NPService.asmx'
                     : %addr(SOAP) + 2
                     : %len(SOAP)
                     : *NULL
                     : %paddr(Incoming)
                     : *NULL
                     : HTTP_TIMEOUT
                     : HTTP_USERAGENT
                     : 'text/xml');



   The problem seem to be that I'm sending real xml in the <dataxml> tag.

   I've tried to convert all the '<' and '>'  to &lt; &gt; in the
   <dataxml> tag but all my tries has resulted in expat message"no
   elements found".

   When I remove the xml data in  <dataxml> tag (empty dataxml) I receive
   a soap response from the web service (just says that there was no data
   in the dataxml tag).  Anyone knows how to build string xml within xml?



   Another question (just quorious):

   Why the +2 in    %addr(SOAP) + 2  ?



   And is is possible to use this (add_soapaction) 2 times (or more) in
   the same program/rc?

    http_xproc( HTTP_POINT_ADDL_HEADER
             : %paddr(Add_SOAPACTION) );





   Best regards

   Magne

References

   1. http://www.w3.org/'
   2. http://www.w3.org/2001/XMLSchema";'
   3. http://schemas.xmlsoap.org/soap/envelope/";>'
   4. https://naturskadekoordinering.no/NaturKoordWebService/";>'
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------