• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Timeout Exception while connecting to a web service

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

We have a client code that connects to a web service written by some other group.Recently we have started getting a lot of Timeout exception while trying to invoke one of service side methods.Our call waits for 2 minutes and times out.When I contacted service side developer,he told me to explicitly set timeout on client side.
So I searched on web and found this -

((BindingProvider)port).getRequestContext().put(JAXWSProperties.CONNECT_TIMEOUT, 300);
((BindingProvider)port).getRequestContext().put(BindingProviderProperties.REQUEST_TIMEOUT, 300);

After putting these two lines,I get SocketTimeOutException(Different from earlier Timeout exception) almost instantly.
Can someone please help?

Thanks.

 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try Asynchronous Client
http://jax-ws.java.net/nonav/2.1.4/docs/asynch.html
 
Jitesh Sinha
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is an option when nothing else works.
What is puzzling is that this call has been working fine for almost 3 years now.Just this month it started throwing out this error.
Here is the stack trace -

javax.xml.ws.soap.SOAPFaultException: Timeout
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP1
1Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPF
aultBuilder.java:119)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMeth
odHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMeth
odHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy32.importDocument(Unknown Source)
 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no cause without an effect. And there is no effect without a cause.

Hypothetical questions:

1. Is there any changes in the network infrastructure?
2. If the code worked so far, then why it worked in the first place?
May be not all use cases were covered under certain conditions on the server side? on the client side or both end.
3. Suppose the client and server covered all cases and are perfect, then what is left? Network issue? Any thing on the server side that could affect the outcome?
 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is that 300 milliseconds?

 
Jitesh Sinha
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is 300 seconds.
I do not have any control over server side.I have been talking to those people who are responsible for it- but they say everything is fine on their side.
 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
0. For now, do not set the timeout on the client side.

1. Check the server side log. Ask the provider have a check.
There might be log on the web container side or server side. That might give some clue.

2. Number checking:

I do not know the technical environment of your specific situation. So are Hypothetical questions:

Imagined Process Flow:
Client --- Server side ---Use JMS --- Use Database

Under normal condition, every thing is OK. Meaning the app was designed for a certain N concurrent requests withing a certain time frame.
It might work, three year ago but not now due to growth of work load N+M concurrent requests.

If during the process, if Database or JMS or Web container can not handle N+M concurrent users then Client is in trouble.

For web container, check number of concurrent thread it can handle.
For Database, number of concurrent connection, was there any deadlock.
For JMS, if the queue is full.

If none of these has any issue, then consider review the whole process flow again - client + server or do some bandage.
reply
    Bookmark Topic Watch Topic
  • New Topic