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

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



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/";'
 + ' xmlns:dom="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
-----------------------------------------------------------------------