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

Re: HTTPAPI (Web Service) sending an XML string as an input parameter to a web service 'brackets'



Dears,

Reading this, I find this hard to believe that something trivial like this, gives so much troubles.

Wouter

Op 16 Nov 2009 om 01:36 heeft "Kevin Groninga" <kevin@xxxxxxxxx<mailto:kevin@xxxxxxxxx>> het volgende geschreven:\


Eureka!   I finally figured out the solution to this pesky problem of the
square brackets  on the CDATA within the SOAP request to the web service!

 After a bit more digging on the web, I finally came across a site that
suggested that I might be able to create those brackets using hex values.
And lo' and behold, that solution worked perfectly.   So here's my solution.

 *  web service SOAP, substitution variables
D var_LBracket    s              1    inz(x'BA')
D var_XMLMsg      s          32767A   varying
D var_RBracket    s              1    inz(x'BB')

/free
 http_SetCCSIDs(1208: 0);
 http_XmlStripCRLF(*ON);
 http_debug(*ON);

 SOAP =
   '<?xml version="1.0" encoding="UTF-8"?>'
 + '<soapenv:Envelope'
 + ' xmlns:soapenv="<http://schemas.xmlsoap.org/soap/envelope/>http://schemas.xmlsoap.org/soap/envelope/";'
 + ' xmlns:dom="<http://dom.w3c.org>http://dom.w3c.org";>'
 + '<soapenv:Header/>'
 + '<soapenv:Body>'
 + '<dom:performAction>'
 + '<!' + var_LBracket + 'CDATA' + var_LBracket
 + %trim(var_XMLMsg)
 + var_RBracket + var_RBracket + '>'
 + '</dom:performAction>'
 + '</soapenv:Body>'
 + '</soapenv:Envelope>';

 rc = http_url_post_xml(%trim(srvServiceURL)
                      : %addr(SOAP) + 2
                      : %len(SOAP)
                      : *NULL
                      : %paddr(Incoming)
                      : %addr(String)
                      : HTTP_TIMEOUT
                      : HTTP_USERAGENT
                      : 'text/xml; charset=utf-8'
                      : %trim(srvBindingURL));

 A quick 'thanks' to Scott and to Elbert for trying to help me through this!


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



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------