I’m trying to connect to a Web service using Sockets
API’s and a SOAP envelope and cannot seem to get the desired results. The API’s themselves seem to function correctly, but
there’s something in the POST and/or SOAP that the server doesn’t
like. The connection is made then the request formatted and sent,
then the server sends an error that indicates a time out. I began by storing the Socket and SOAP statements in a file
and having the program build the request prior to sending it, to minimize
compiles if the request needed to change, but am now down to hard coding it in
the program and will return to that approach when I can actually get this to
work. The request as it currently is constituted looks like this: request = 'POST /axis/services/JdaAccountService HTTP/1.1' +
x'0D25' +
'Content-Length: 512' + x'0D25' +
'Host: prod4app1.gspt.net:7901' + x'0D25'
+
'Content-Type: text/xml; charset=utf-8' + x'0D25'
+
'SOAPAction: http://www.gsicommerce.com/schemas/content' +
x'0D25' + '<?xml
version="1.0"?>' + x'0D25'
+
'<SOAP-ENV:Envelope'
+
'SOAP-ENV:encodingStyle='
+
'http://www.w3.org/2001/12/soap-encoding>' + x'0D25' +
'<SOAP-ENV:Body xmlns:m="http://jas.commerce.com">'
+
x'0D25' + '<SOAP-ENV:encodingStyle='
+
'http://schemas.xmlsoap.org/soap/endcoding/>'
+
x'0D25' + '<m:getJdaAccount>' + x'0D25'
+
'<m:storeCode>TSA</m:storeCode>' + x'0D25'
+
'</m:getJdaAccount>' + x'0D25'
+
'</SOAP-ENV:Body>' + x'0D25'
+
'</SOAP-ENV:Envelope>' + x'0D25' + x'0D25';
I’ve also done a GET as shown below, and received the
expected response from the same service. request = 'GET /axis/services/JdaAccountService HTTP/1.1' +
x'0D25' + 'Content-Length:
512' + x'0D25'
+
'Host:
: prod4app1.gspt.net:7901' + x'0D25' + x'0D25'; When I try the POST, here’s the
response from the server as passed back to my RPG program. HTTP/1.1 500
Internal Server
Error
Date: Tue, 23 Aug
2005 14:05:09
GMT
Server: WebLogic
Server 8.1 SP2 Fri Dec 5 15:01:51 PST 2003
316284
Content-Type:
text/xml;
charset=utf-8
Transfer-Encoding:
chunked
01c2
<?xml
version="1.0"
encoding="UTF-8"?>
. <soapenv:Envelope xmlns:soapenv="http://schemas.xm
lsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3 .org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/ 2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultc ode>
<faultstring>java.net.SocketTimeoutException: R ead timed
out</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
0000 The error message was also returned using
Scott’s error trapping API as follows:
3450 Descriptor not
valid. Help! Any suggestions? Please bear in
mind that I’m a KISS principle kind of guy with no previous WEB, Sockets,
and/or SOAP experience. Thank. Steen Lemon, Sr. P/A GSI Commerce |