We are using a simple java service type to invoke a web service call. We are not using webservice invocation service type (*.esbws).We have used axis1.4 as web service provider. First we deployed the dummy web service in tomcat in a local machine. Our sonic service invokes the web service sucessfully & we get proper response. Next we make the call to an external url ( the real web service), we get a soap fault :
<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.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
</faultcode>
<faultstring>
org.xml.sax.SAXParseException: Premature end of file.
</faultstring>
<detail>
<ns1:hostname xmlns:ns1=\"http://xml.apache.org/axis/\">
scde4
</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
If we telnet to the real web service & send the soap request we get proper soap response. This goes to show that there is nothing wrong with the web service.
Moreover, I would like to use tcpmon to capture packets.How to do that with a sonic service?
Please help.
Regards,
Subhendu
Eclipse (and Sonic Workbench) comes with a TCP/IP monitor. You would have it proxy the external service and call it locally. That is, configure localhost:8080 to go to your external webservice and then simply use your ESB service to go to the local URL.
Hi William,
Thanks for the reply.
I captured the soap request through TCPMon. It has got a header "Transfer-Encoding" with the value "chunked". Looks like this is what is causing problem.Is there any way we can instruct sonic to send the soap request at one go?
Regards,
Subhendu
You said you were not using the ESBWS file, so Sonic is not managing the SOAP request. Maybe I misunderstood your original post, but it looked like you were saying that Sonic's web stack is not being used and that you wrote a custom service for the web request.
smahanta wrote:
[we use a] simple java service type to invoke a web service call. We are not using webservice invocation service type (*.esbws)
Hi William,
You understood me correctly.Sonic's web-stack is not being used.
Are you suggesting that if we use sonic's web stack, the web service call will be sucessful?
Most peculiar thing is this was working correctly couple of months back. Only thing that has changed is that we have deployed it to a different machine & now it is deployed through SDM(Sonic Deployment Manager).
Regards,
Subhendu
smahanta wrote:
...Are you suggesting that if we use sonic's web stack, the web service call will be sucessful?
[snip]
I think it should work. I don't recall any issues with Web Services that use chunked encoding (but this is normally specified by the client, not the server). My point was more this:
"If you are writing the web client yourself, then no Sonic setting would impact the behavior of your code."
smahanta wrote:
[snip]
Most peculiar thing is this was working correctly couple of months back. Only thing that has changed is that we have deployed it to a different machine & now it is deployed through SDM(Sonic Deployment Manager).
SDM is just a deployment mechanism. As long as the environment is the same, it should not matter how it was deployed. So, this is unlikely to be an SDM issue but I would check:
Hi William,
Thanks for the help.
I added following lines in the stub to turn off transfer-encoding chunked:
Hashtable httpHeaders = new Hashtable();
httpHeaders.put(HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED, false);
_call.setProperty(HTTPConstants.REQUEST_HEADERS, httpHeaders);
And it is working for the particular web service which was not working.
So your suggestion "has the Web Service changed?" may be true.
Regards,
Subhendu