You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by ge...@ws.apache.org on 2005/01/11 11:49:36 UTC
[Apache Web Services Wiki] New: FrontPage/Axis/JavaTimeout
Date: 2005-01-11T02:49:36
Editor: ToshiyukiKimura
Wiki: Apache Web Services Wiki
Page: FrontPage/Axis/JavaTimeout
URL: http://wiki.apache.org/ws/FrontPage/Axis/JavaTimeout
Importing old wiki ...
New Page:
##language:en
'''Q: How do I set a timeout when using {{{ WSDL2Java }}} stubs?'''
A: There is a setTimeout method on the org.apache.axis.client.Stub class, which is the class all emitted stubs extend.
Here is how to set the timeout given a service named Foo:
{{{
FooServiceLocator loc = new FooServiceLocator();
FooService binding = loc.getFooService();
org.apache.axis.client.Stub s = (Stub) binding;
s.setTimeout(1000); // 1 second, in miliseconds
}}}
The default timeout in Axis 1.1 and later is 60 seconds. Axis 1.0 did not have a default timeout (i.e. it defaulted to 0). This timeout value is set on the HTTP socket and is not a connection timeout, which requires implementation we do not have as of Axis 1.1.
'''Q: When I do setTimeout(15*10000) or more bigger,I still get the error below when I connect http url, but localhost url is ok:'''
{{{
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:512)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection .java:489)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon nection.java:617)
at java.net.URL.openStream(URL.java:913)
at org.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultRe
aderFactory.java:149)
at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocume nt(DefaultEntityHandler.java:491) at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:3 12)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1080)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.
java:195)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:322)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:367)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:384)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
at java.lang.Thread.run(Thread.java:534)
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:512)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection .java:489)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon nection.java:617)
at java.net.URL.openStream(URL.java:913)
at org.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultRe
aderFactory.java:149)
at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocume nt(DefaultEntityHandler.java:491) at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:3 12)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1080)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.
java:195)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:322)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:367)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:384)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:245)
at java.lang.Thread.run(Thread.java:534)
}}}
does there need some other setting?please tell me.Thanks.