AXIS2 webservice client java.net.SocketException: Connection reset
I'm creating a client using axis2 to consume a third party ws, everything works fine in the tomcat server in my machine,开发者_JAVA技巧 but once deployed to the server I'm not able to run it.
I have already checked:
- Third party URL is up and running
- No firewalls in the server
- Tomcat reports AXIS2 is working correctly (checking the AXIS2 happy page)
[INFO] Unable to sendViaPost to url[http://third.party.URL]
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
Any suggestions?
FOUND IT! actually is not something about the Tomcat server but the AXIS2 Client configuration, by this post http://wso2.org/forum/thread/1878
You might need to set the HEADER_PROTOCOL_10 in the stub properties.
Options options=stub._getServiceClient().getOptions();
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_PROTOCOL_VERSION,org.apache.axis2.transport.http.HTTPConstants.HEADER_PROTOCOL_10);
Now works!!!
精彩评论