you can use stub._getServiceClient().getOptions().setTimeOutInMilliSeconds();
or stub._getServiceClient().getOptions().setProperty(); to set any property. thanks, Amila. On Wed, Mar 24, 2010 at 9:37 PM, Christian Gosch <[email protected]>wrote: > No one answered, so I searched and found: > > If I use a generated class based on "org.apache.axis2.client.Stub", then > there is a method "addPropertyToOperationClient(OperationClient > operationClient, String propertyKey, Object propertyValue)", which > simply executes "operationClient.getOptions().setProperty(propertyKey, > propertyValue);". > > (There are variants for other basic types like int.) > > This can be used to set properties controlling the behaviour of e. g. > the underlying apache commons http client, like this: > > addPropertyToOperationClient(_operationClient, HTTPConstants.SO_TIMEOUT, > 30000); > > This should obviously be executed just before executing the "real" > operation, thus refining the generated code. Since the generated code > repeats nearly everything for every operation, code like this must > eventually be added in lots of methods. > > *What* can be controlled may generally be seen by inspecting the > HTTPConstants class. For this topic, the code above works fine. > > :-) > > Christian > > > > -----Original Message----- > > From: Christian Gosch > > Sent: Tuesday, March 23, 2010 4:45 PM > > To: axis-user > > Subject: Q: How to set Timeout for SOAP calls? [SOAP-Client built with > > Axis2 1.4.1 / XMLbeans 2.3.0 on JRE 1.4.2 (IBM WAS60)] > > > > Hi, > > > > how can I set the Timeout for SOAP calls made from a client built from > a > > WSDL using Axis2 1.4.1 w/ XMLbeans 2.3.0, running on a IBM WAS60 > > AppServer (JRE: IBM JRE 1.4.2)? > > > > > > Currently, the Timeout is about 30sec, which is OK for so far, but it > > would be useful to decrease it to 10-15sec, since most actual calls to > > the actual service are answered in less than 10sec. > > > > > > The stack trace of a timeout starts as follows (and proceeds with > > locations in my own app, which is not relevant here): > > > > > > [3/23/10 0:03:56:483 MET] 0000005b HTTPSender I > > org.apache.axis2.transport.http.HTTPSender sendViaPost Unable to > > sendViaPost to url[http://**.**.**.**/] > > 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.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.jav > > a:1116) > > at > > > org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpCon > > nectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413) > > at > > > org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBa > > se.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(HttpMe > > thodDirector.java:398) > > at > > > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMetho > > dDirector.java:171) > > at > > > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3 > > 97) > > at > > > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3 > > 46) > > at > > > org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Abstrac > > tHTTPSender.java:542) > > at > > > org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:1 > > 89) > > at > > org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75) > > at > > > org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageW > > ithCommons(CommonsHTTPTransportSender.java:371) > > at > > > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Common > > sHTTPTransportSender.java:209) > > at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448) > > at > > > org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper > > ation.java:401) > > at > > > org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA > > xisOperation.java:228) > > at > > > org.apache.axis2.client.OperationClient.execute(OperationClient.java:163 > > ) > > at de.dc.jnet.xoa.wsclient.XOAStub.ListCreate(XOAStub.java:6871) > > [...] > > > > > > Thanks for help, > > -- > > Dipl.-Inform. Christian Gosch, PMI PMP > > Systems Architecture, Project Management > > > > inovex GmbH > > Büro Pforzheim > > Karlsruher Strasse 71 > > D-75179 Pforzheim > > Tel: +49 (0)7231 3191-85 > > Fax: +49 (0)7231 3191-91 > > [email protected] > > www.inovex.de > > > > Sitz der Gesellschaft: Pforzheim > > AG Mannheim, HRB 502126 > > Geschäftsführer: Stephan Müller > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > !DSPAM:4ba8e21317329309814760! > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
