[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
HTTPAPI (Web Service) sending an XML string as an input parameter to the service
I was wondering if someone could help to to debug a problem that I'm
having in working with the HTTPAPI tool and trying to consume a web
service from the iSeries.
This is a rather lengthy problem, but essentially I'm trying to
consume a web service from an RPG on the AS400. Within that SOAP
message that I construct, instead of having regular parameters (like a
name or address etc.), I'm having to send an XML message. I understand
that the XML message that I'm trying to send must be enclosed within
the <![CDATA[ xml message ]]> delimiters. therein lies part of the
problem. It appears the web service service needs me to use UTF-8
encoding and when I attempt to send my message, I get back an error
that the straight bracket [] characters are unrecognized. Obviously
this is an issue of the request coming from an iSeries which is
EBCDIC. I've tried several variations and combinations of encodings
like UTF-8, UTF-16, ISO-8859-1 and EBCDIC. I've also tried replacing
the [] characters in my string with the HTML representations of [
and ], but to no avail.
I'd be more than happy to send you the RPG source code that I've been
working with as well as any other supporting information like the WSDL
etc.
Sincerely (and somewhat frustrated),
Kevin Groninga
Kevin@xxxxxxxxx
BTW, here's what the entire SOAP message is 'supposed' to look like. I
developed and tested this using the SoapUI v3.0.1 tool. When sent from
this tool, this message works perfectly. But when sent from the AS400,
it fails.
<soapenv:Envelope
xmlns:soapenv="[1]http://schemas.xmlsoap.org/soap/envelope/"
xmlns:dom="[2]http://dom.w3c.org">
<soapenv:Header/>
<soapenv:Body>
<dom:performAction><![CDATA[<Message source="iSeries"
target="CWSerenade" type="CWPICKIN"><CWPickIn company="100"
pick_control="5" date_sent="11052009" time_sent="114639"
transaction_type="B" auto_bill="Y"><PickDetails><PickDetail
pick_line_nbr="3" qty_shipped="1"/><PickDetail pick_line_nbr="2"
qty_shipped="1"/><PickDetail pick_line_nbr="1"
qty_shipped="0"/></PickDetails><CartonHeaders><CartonHeader
carton_nbr="1" ship_date="11052009" ship_time="122200" weight="12.10"
tracking_nbr="99999997" ship_via="1"
packer="ARA"><CartonDetails><CartonDetail carton_line_nbr="1"
pick_line_nbr="2"
qty_packed="1"/></CartonDetails></CartonHeader><CartonHeader
carton_nbr="2" ship_date="11052009" ship_time="122500" weight="5.78"
tracking_nbr="99999998" ship_via="1"
packer="ARA"><CartonDetails><CartonDetail carton_line_nbr="2"
pick_line_nbr="3"
qty_packed="1"/></CartonDetails></CartonHeader></CartonHeaders></CWPic
kIn></Message>]]></dom:performAction>
</soapenv:Body>
</soapenv:Envelope>
And finally here is what is captured in the /tmp/httpapi_debug.txt
file from the IFS.
HTTPAPI Ver 1.21 released 2007-10-01
New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819.
ProtLoc=0
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry : 2
DNS resolver options: x'00000136'
DNS default domain: xxxxxxxx.NET
DNS server found: 10.7.34.176
DNS server found: 10.7.34.177
http_persist_post(): entered
http_long_ParseURL(): entered
do_post(): entered
POST /CWDirectCPService/services/CWPickIn HTTP/1.1
Host: 10.7.43.111:8080
User-Agent: http-api/1.21
Content-Type: text/xml
SOAPAction:
Expect: 100-continue
Content-Length: 1116
recvresp(): entered
HTTP/1.1 100 Continue
SetError() #13: HTTP/1.1 100 Continue
senddoc(): entered
<soapenv:Envelope
xmlns:soapenv="[3]http://schemas.xmlsoap.org/soap/envelope/"
xmlns:dom="[4]http://dom.w3c.org"><soapenv:Header/><soapenv:Body><dom:
performAction><!ÝCDATAÝ<Message source="iSeries" target="CWSerenade"
type="CWPICKIN"><CWPickIn company="100" pick_control="5"
date_sent="11132009" time_sent="073416" transaction_type="B"
auto_bill="Y"><PickDetails><PickDetail pick_line_nbr="3"
qty_shipped="1"/><PickDetail pick_line_nbr="2"
qty_shipped="1"/><PickDetail pick_line_nbr="1"
qty_shipped="0"/></PickDetails><CartonHeaders><CartonHeader
carton_nbr="1" ship_date="11052009" ship_time="122200" weight="12.10"
tracking_nbr="99999997" ship_via="1"
packer="ARA"><CartonDetails><CartonDetail carton_line_nbr="1"
pick_line_nbr="2"
qty_packed="1"/></CartonDetails></CartonHeader><CartonHeader
carton_nbr="2" ship_date="11052009" ship_time="122500" weight="5.78"
tracking_nbr="99999998" ship_via="1"
packer="ARA"><CartonDetails><CartonDetail carton_line_nbr="2"
pick_line_nbr="3"
qty_packed="1"/></CartonDetails></CartonHeader></CartonHeaders></CWPic
kIn></Message>¨¨></dom:performAction></soapenv:Body></soapenv:Envelope
>
recvresp(): entered
HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP01 (build:
SVNTag=JBPAPP_4_3_0_GA_CP01 date=200804211657)/Tomcat-5.5
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Fri, 13 Nov 2009 22:47:18 GMT
Connection: close
SetError() #13: HTTP/1.1 500 Internal Server Error
recvdoc parms: chunked 0
header_load_cookies() entered
recvchunk(): entered
get_chunk_size(): entered
22a
chunk size = 554
get_chunk_size returned 554
calling comm_blockread
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="[5]http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="[6]http://www.w3.org/2001/XMLSchema"
xmlns:xsi="[7]http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body
><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><fa
ultstring>org.xml.sax.SAXParseException: bad continuation of
multi-byte UTF-8 sequence (code:
0x43)</faultstring><detail><ns1:hostname
xmlns:ns1="[8]http://xml.apache.org/axis/">d-oeapp01</ns1:hostname></d
etail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
comm_blockread returned 554
get_chunk_size(): entered
0
chunk size = 0
get_chunk_size returned 0
SetError() #13: HTTP/1.1 500 Internal Server Error
http_close(): entered
References
1. http://schemas.xmlsoap.org/soap/envelope/
2. http://dom.w3c.org/
3. http://schemas.xmlsoap.org/soap/envelope/
4. http://dom.w3c.org/
5. http://schemas.xmlsoap.org/soap/envelope/
6. http://www.w3.org/2001/XMLSchema
7. http://www.w3.org/2001/XMLSchema-instance
8. http://xml.apache.org/axis/
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------