Link to home
Start Free TrialLog in
Avatar of cinglez
cinglezFlag for Brazil

asked on

Unable to sendViaPost to url

Hello. I've been trying to consume a webservice for my company. This webservice sends a XML file (Axis2).

The address is http://200.201.194.78/WsNFe2/LoteRps.jws.

When I use my home network, or a 3G internet access, it works fine, and returns me another XML. But on my corporate network it always gives me the following error:

[INFO] Deploying module: metadataExchange-1.5.1 - file:/Users/CInglez/NFSe_Campinas/Bin/lib/mex-1.5.1.jar
[INFO] Unable to sendViaPost to url[http://200.201.194.78/WsNFe2/LoteRps.jws]
java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      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)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
      at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
      at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
      at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
      at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
      at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
      at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
      at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
      at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at _78._194._201._200.wsnfe2.loterps_jws.LoteRpsServiceStub.consultarLote(LoteRpsServiceStub.java:241)
      at RPS.NFSe.processa(NFSe.java:86)
      at RPS.NFSe.main(NFSe.java:139)
org.apache.axis2.AxisFault: Read timed out
      at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
      at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:203)
      at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
      at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
      at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at _78._194._201._200.wsnfe2.loterps_jws.LoteRpsServiceStub.consultarLote(LoteRpsServiceStub.java:241)
      at RPS.NFSe.processa(NFSe.java:86)
      at RPS.NFSe.main(NFSe.java:139)
Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      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)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
      at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
      at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
      at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
      at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
      at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
      ... 10 more

It seems to me there is a firewall rule blocking something, but the IT people says there is not.

What could I try?

Thanks in advance.

Carlos
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

use tcpmon to observe the request you get from the server, this may help you to locate the problem.
http://ws.apache.org/commons/tcpmon/
One thing you may want to check is if there are any firewall rules that are filtering your internal access. Is there any access to the service over any other ports other then 80?
Avatar of cinglez

ASKER

I do not have access to the firewall, but infrastructure guys insist the is nothing blocking traffic.
What web service/technologies (apache, tomcat, etc) are you using for this application?
Note that "SocketTimeoutException: Read timed out".
Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      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)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
      at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)

Check into those lines on the timeout. Also, you can try a packet capture from that server on port 80 to see what traffic is being sent/received (test at the dev server and your box).
ASKER CERTIFIED SOLUTION
Avatar of cinglez
cinglez
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial