Connection timeout on web service import

Here’s a short write-up of the answer to a question I was posed by a colleague yesterday: how do you set the timeout for a web service import? The answer, as any good consultant would say, is that it depends…

If you’re using JAX-RPC bindings then you have a couple of options. To set the timeout at development time, right-click on the module in the Business Integration View of WebSphere Integration Developer and select Open Deployment Editor. Then select the Imports tab and then the slightly misleadingly named WS-Security Bindings tab. Select the import in question and then scroll down and expand the Port Qualified Name Binding Details. Here you will find the required property which is called Synchronization timeout. Alternatively, you can set the timeout after deployment of the module using the mechanism described in this technote.

If you’re using a JAX-WS binding then you need to take a different approach. In the server runtime, define a new policy set that contains a HTTP transport policy as described in the Application Server InfoCenter. This policy set has a Connection timeout property (in addition to many other settings). Export the policy set and then import it in to WebSphere Integration Developer (File > Import then Web services > WebSphere Policy Sets). At this point I then had to restart WebSphere Integration Developer to pick up the new policy set. Then select the import on the assembly diagram and on the Properties tab select the Binding > Policy Sets panel. Here you can select the default policy set for the binding.

15 Responses to “Connection timeout on web service import”

  1. Awesome! This is exactly what I was looking for. Thanks for these extremely helpful tips.

    Few observations:
    1. I assumed that the value set in JAX-RPC Synchronization timeout (set in JAX-RPC case) in seconds. Is that correct? How about “Connection timeout ” in JAX-WS case?
    2. The technote link (http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg21231500) seem to be invalid/removed.
    3. When I tried this, the (unmodelled fault) faultstring received by my service invoke primitive’s was “java.net.SocketTimeoutException: Async operation timed out”. This was little weird since my service invoke was making synchronous call to the WS, even though I do not understand how it works behind the scene.

    thanks
    Ishwara Varnasi

    • Dave says:

      Hi Ishwara,

      Thanks for the feedback – looks like you have some good info on your own site too. In response to your observations:

      1. Yes – I believe they’re both in seconds.
      2. Hmm – that’s odd. Thankfully Google still has a cache of the page so I’ve copied the details below.
      3. I believe the “async” just refers to the fact that it is using the Java Async IO API i.e. nothing to do with async SCA.

      Administrative Console V6.0

      1. Select Applications -> Enterprise Applications -> -> Web Modules -> -> Web Services Client Bindings
      2. Click “Edit…” under Port Information
      3. From this page, you can set the Request Timeout (SyncTimeout) to any value in seconds
      4. Click OK and Save changes

      Note: Saving the changes restarts the application

      Wsadmin v6.0

      1. Start Wsadmin and issue the following commands:

      wsadmin>$AdminApp edit {-WebServicesClientBindPortInfo {{ }}}
      wsadmin>$AdminConfig save

      Note: If you are using a web client, you can omit the parameter by passing {} in its place.

    • Kumar says:

      Hi Dave,

      We need to set a timeout for all the http/ https requests coming to WebSphere Process Server 6.2.0.2. And this should be 30 secs. Is there any way to set it at server level rather than application level?

      Also if any import binding needs more than 30 secs I will set in the JAX-RPC synchronization timeout setting. In this case will this override the server timeout which I mentioned above?

      Please let me know your thoughts.

  2. Dave,
    Is it possible also to manipulate timeout of whole mediation?
    Something like global transaction timeout per mediation?

    Thank you
    Elena

    • Dave says:

      Elena,

      Not that I’m aware of. With the JAX-WS policy set approach it is, however, relatively easy to have the same policy applied to every import.

      Regards,
      David

  3. Muru says:

    Dear Dave,

    We are struggling to handle Connection time out in ESB. Our requirement we call a SAP Adapter , if it get timeouts we need to catch the transaction timeout error and send notification to support.In the callout node there is no timeout terminal.We couldnt catch the time out in any of the fail termina. We are thinking of using service invokde primitive. Not sure that is the idle approach. Can you suggest any thing on this?

    • Dave says:

      See my response on the developerWorks forum.

    • sunam says:

      Hi muru,
      Did u get the solution . We have a solution with us.
      If required just mail me.

      • Muru says:

        We got it sunam.. We used the transcation supported adapter, then we are able to catch ithe transaction timeout in respone call fail termincal

        • Raj says:

          Hi Muru/Sunam,
          Can you please share your solution for this problem, we are in a similar situation…have a service invoke and the external web service that service invoke is calling, never responds back, but timeout terminal is not getting triggered since this is a synchronous call.

  4. Gianluca says:

    Hi David, thanks for your article, I was able to change the timeout via admin console, but I wasn’t aware of the Deployment Editor approach.
    Unluckily it doesn’t solve my problem: I have an import with a one way invocation that times out ( raising an AsyncTimeoutException ) after 60 seconds, no matter what value is set for the syncTimeout property. Do you have any advice?
    Thanks!
    Gianluca

  5. Kumar says:

    Hi Dave,

    Is there any way to set the timeout for JAX-WS import binding? The above scenario is working fine for Export but I need to set on Import component.

    Thanks.

  6. Eryx says:

    Great advice! Is the only place i have found where a possibility to timeout synchronous web services calls is proposed other than setting server transaction timeout.

  7. RY says:

    Great advice. Any suggestions on implementing timeout for CICS Import bindings? Appreciate in advance.