Soniya,
Thanks for the information. I was finally able to up the
timeout time by going into the WSDL2JAVA generated stub and finding
where a call is created in my getAvnData() method and adding
call.setTimeout() there.
Best regards,
Steve
-----Original Message-----
From: Shah, Soniya M. [RA] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 03, 2004 11:39 AM
To: '[EMAIL PROTECTED] '
Subject: RE: java.net.SocketTimeoutException: Read timed out
I have tested timeout upto 4 minutes and it is o.k.
Only difference is I use call.invoke
Soniya
-----Original Message-----
From: Kirby, Stephen (Civ,ARL/CISD)
To: [EMAIL PROTECTED]
Cc: Kirby, Stephen (Civ,ARL/CISD)
Sent: 2/3/2004 11:30 AM
Subject: java.net.SocketTimeoutException: Read timed out
Hi,
I have a web service that I am testing out. I can see that the web
service is deployed and starts up OK. However, when I call one of its
methods, getAvnData() in a client program, I am seeing a read timed out
error (after 60 secs) as below. The getAvnData() method of the Mm5Avn
web service simply calls a shell script which triggers an ftp. The file
it is getting is quite large, 26MB , so the socket read failure is
caused by the ftp not being completed.
Is there an easy way around this read timeout problem, such as a way
to up the timeout time (of 60s) so the ftp can finish before another
read occurs on that socket?
Alternatively, in looking at FAQ's I found the setTimeout() method but
I haven't succeeded in getting past the 60 sec (this appears to be the
default) timeout. Since I used "call" for the setTimeout(), I probably
need to use "call" to invoke the service also but I don't know how to
use it to get a handle to the service method, "getAvnData()". Maybe
someone can enlighten me.
Below I list the source code and then the error output.
Thanks .
Best Regards,
Steve
Client Program Source:
========================================================================
================
package mm5avn;
import java.net.*;
import java.io.*;
import org.apache.axis.client.Call;
public class Mm5AvnTester{
public static void main(String []args) throws Exception{
//make a service
mm5avn.ws.Mm5AvnService service=
new mm5avn.ws.Mm5AvnServiceLocator();
Integer i = Integer.valueOf("9000000");
Call call = (Call) service.createCall();
call.setTimeout(i);
//get a stub to the service
mm5avn.ws.Mm5Avn inst = service.getmm5avn();
//call getAvnData to kick off the ftp
inst.getAvnData(); //make the call
}
}
Error output:
========================================================================
============
Exception in thread "main" AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.SocketTimeoutException: Read timed out
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
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:183)
at
java.io.BufferedInputStream.read(BufferedInputStream.java:201)
at
org.apache.axis.transport.http.HTTPSender.readHeadersFromSocket(HTTPSend
er.java:506)
at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:127)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.j
ava:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at
mm5avn.ws.Mm5AvnSoapBindingStub.getAvnData(Mm5AvnSoapBindingStub.java:11
0)
at mm5avn.Mm5AvnTester.main(Mm5AvnTester.java:12)
java.net.SocketTimeoutException: Read timed out
at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:131)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.j
ava:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at
mm5avn.ws.Mm5AvnSoapBindingStub.getAvnData(Mm5AvnSoapBindingStub.java:11
0)
at mm5avn.Mm5AvnTester.main(Mm5AvnTester.java:12)
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:183)
at
java.io.BufferedInputStream.read(BufferedInputStream.java:201)
at
org.apache.axis.transport.http.HTTPSender.readHeadersFromSocket(HTTPSend
er.java:506)
at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:127)
... 11 more