Dana, I’m not sure about the encoding
because we have a web service here that I can consume with the utf-8
encoding. I will attach the complete code I have which works for
me. The only real difference I see between mine and yours is the URI of
the SOAPAction (your web service is expecting tempuri.org) and the parameters
the web service expects. Here’s what our web service is asking for
and what it returns. Basically it wants 3 parameters: Crop Year, State
ID, and Insurance Type and returns back one string. This works fine for
me using HTTPAPI version 1.15 (it worked on 1.13 as well). SOAP The
following is a sample SOAP request and response. The placeholders shown need to be replaced with actual values. POST /CimaxReturnType_clsXMLReturn.asmx HTTP/1.1 Host: dvcifyiapp1 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://rcis.com/LoadROList" <?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> <LoadROList
xmlns="http://rcis.com/"> <sintCropYear>short</sintCropYear> <sintStateId>short</sintStateId> <sintInsuranceType>short</sintInsuranceType> </LoadROList> </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> <LoadROListResponse
xmlns="http://rcis.com/"> <LoadROListResult>string</LoadROListResult> </LoadROListResponse> </soap:Body> </soap:Envelope> From: owner-
|
H DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR('LIBHTTP/HTTPAPI') D/copy libhttp/qrpglesrc,httpapi_h D count s 10I 0 D rc s 10I 0 D x s 10I 0 D msg s 52A D CRLF C CONST(x'0d25') D data S 1024A Varying * D odslist ds occurs(200) D ods_STRING 1024A varying ** D addCount PR D void * D depth 10I 0 value D name 1024A varying const * D mapData PR D void * D depth 10I 0 value D name 1024A varying const D path 24576A varying const D value 32767A varying const * c eval *inlr = *on /free data = '<?xml version="1.0" encoding="utf-8"?>' + CRLF + '<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/">' + CRLF + ' <soap:Body>' + CRLF + ' <LoadROList xmlns="http://rcis.com/">' + CRLF + ' <sintCropYear>2005</sintCropYear>' + CRLF + ' <sintStateId>27</sintStateId>' + CRLF + ' <sintInsuranceType>11</sintInsuranceType>' + CRLF + ' </LoadROList>' + CRLF + ' </soap:Body>' + CRLF + '</soap:Envelope>'; http_debug(*On); rc = http_url_POST_XML('http://dvcifyiapp1:8080/' + 'CimaxReturnType_clsXMLReturn.asmx' : %addr(data) + 2 : %len(data) : %paddr(addCount) : %paddr(mapData) : *NULL : HTTP_TIMEOUT : HTTP_USERAGENT : 'text/xml; charset=utf-8' : '"http://rcis.com/LoadROList"'); if rc <> 1; msg = http_error(); dsply msg; endif; for x = 1 to count; %occur(odslist) = x; endfor; return; /end-free P addCount B D addCount PI D void * D depth 10I 0 value D name 1024A varying const /free if name = 'LoadROListResult'; count = count + 1; %occur(odslist) = count; endif; /end-free P E P mapData B D mapData PI D void * D depth 10I 0 value D name 1024A varying const D path 24576A varying const D value 32767A varying const /free if name = 'LoadROListResult'; ods_STRING = %trim(value); endif; /end-free P E