Timeout on client side when calling web service method

Discussion in 'Java' started by Ale, Dec 28, 2010.

  1. Ale

    Ale Guest

    Hello,

    I've a client calling a web service method (using JAX-WS), which
    randomically doesn't receive any answer or error, or exception, so
    that client waits forever without dying.

    I can't touch the web service code, but I can add a client timeout;
    the issue is that using these props

    System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
    System.setProperty("sun.net.client.defaultReadTimeout", "300000");

    it doesn't work because they only deal with network connection (which
    of course doesn't disconnect)

    Any suggestion ?

    Thanks a lot,
    Ale
     
    Ale, Dec 28, 2010
    #1
    1. Advertising

  2. Ale

    Lew Guest

    Ale wrote:
    > I've a client calling a web service method (using JAX-WS), which
    > randomically doesn't receive any answer or error, or exception, so
    > that client waits forever without dying.
    >
    > I can't touch the web service code, but I can add a client timeout;
    > the issue is that using these props
    >
    > System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
    > System.setProperty("sun.net.client.defaultReadTimeout", "300000");
    >
    > it doesn't work because they only deal with network connection (which
    > of course doesn't disconnect)
    >
    > Any suggestion ?
    >


    http://www.lmgtfy.com/?q=Java web service client timeout

    --
    Lew
     
    Lew, Dec 28, 2010
    #2
    1. Advertising

  3. Ale

    Arne Vajhøj Guest

    On 28-12-2010 16:12, Lew wrote:
    > Ale wrote:
    >> I've a client calling a web service method (using JAX-WS), which
    >> randomically doesn't receive any answer or error, or exception, so
    >> that client waits forever without dying.
    >>
    >> I can't touch the web service code, but I can add a client timeout;
    >> the issue is that using these props
    >>
    >> System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
    >> System.setProperty("sun.net.client.defaultReadTimeout", "300000");
    >>
    >> it doesn't work because they only deal with network connection (which
    >> of course doesn't disconnect)
    >>
    >> Any suggestion ?
    >>

    >
    > http://www.lmgtfy.com/?q=Java web service client timeout


    It was definitely not hard.

    But was it useful??

    Arne
     
    Arne Vajhøj, Dec 28, 2010
    #3
  4. Ale

    Lew Guest

    On 12/28/2010 05:05 PM, Arne Vajhøj wrote:
    > On 28-12-2010 16:12, Lew wrote:
    >> Ale wrote:
    >>> I've a client calling a web service method (using JAX-WS), which
    >>> randomically doesn't receive any answer or error, or exception, so
    >>> that client waits forever without dying.
    >>>
    >>> I can't touch the web service code, but I can add a client timeout;
    >>> the issue is that using these props
    >>>
    >>> System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
    >>> System.setProperty("sun.net.client.defaultReadTimeout", "300000");
    >>>
    >>> it doesn't work because they only deal with network connection (which
    >>> of course doesn't disconnect)
    >>>
    >>> Any suggestion ?
    >>>

    >>
    >> http://www.lmgtfy.com/?q=Java web service client timeout

    >
    > It was definitely not hard.
    >
    > But was it useful??


    I am not clear what the antecedent for "it" is in that sentence. Do you mean
    the links that result from that search? I pursued several and they do bear on
    the OP's question, many of them. You don't think I'd post a link without
    verifying its usefulness, do you?????????????????????????????????????????????

    --
    Lew
    Ceci n'est pas une pipe.
     
    Lew, Dec 29, 2010
    #4
  5. On 28-12-2010 19:13, Lew wrote:
    > On 12/28/2010 05:05 PM, Arne Vajhøj wrote:
    >> On 28-12-2010 16:12, Lew wrote:
    >>> Ale wrote:
    >>>> I've a client calling a web service method (using JAX-WS), which
    >>>> randomically doesn't receive any answer or error, or exception, so
    >>>> that client waits forever without dying.
    >>>>
    >>>> I can't touch the web service code, but I can add a client timeout;
    >>>> the issue is that using these props
    >>>>
    >>>> System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
    >>>> System.setProperty("sun.net.client.defaultReadTimeout", "300000");
    >>>>
    >>>> it doesn't work because they only deal with network connection (which
    >>>> of course doesn't disconnect)
    >>>>
    >>>> Any suggestion ?
    >>>>
    >>>
    >>> http://www.lmgtfy.com/?q=Java web service client timeout

    >>
    >> It was definitely not hard.
    >>
    >> But was it useful??

    >
    > I am not clear what the antecedent for "it" is in that sentence. Do you
    > mean the links that result from that search?


    Yes.

    > I pursued several and they
    > do bear on the OP's question, many of them.


    I tried the first 10 links and as far as I can tell they do not
    provide a solution for the question asked.

    What link do you think provide a solution?

    Arne
     
    Arne Vajhøj, Dec 29, 2010
    #5
  6. Ale

    Lew Guest

    On 12/28/2010 08:55 PM,
    Lew wrote:
    >> I am not clear what the antecedent for "it" is in that sentence. Do you
    >> mean the links that result from that search?


    Arne Vajhøj wrote:
    > Yes.
    >
    >> I pursued several and they
    >> do bear on the OP's question, many of them.


    Arne Vajhøj wrote:
    > I tried the first 10 links and as far as I can tell they do not
    > provide a solution for the question asked.
    >
    > What link do you think provide a solution?


    Ahem. I didn't say "provide a solution", I said "bear on the ... question".

    http://objectmix.com/weblogic/573926-setting-timeout-web-service-client.html
    was one that discussed timing out without mentioning that it was a connection
    timeout but a read timeout. Without doing the deeper research I trust the OP
    will have done by now, I cannot say how much that information translates to
    the OP's question:
    > I've a client calling a web service method (using JAX-WS), which
    > randomically doesn't receive any answer or error, or exception, so
    > that client waits forever without dying.
    >
    > I can't touch the web service code, but I can add a client timeout;
    > the issue is that using these props
    >
    > System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
    > System.setProperty("sun.net.client.defaultReadTimeout", "300000");
    >
    > it doesn't work because they only deal with network connection (which
    > of course doesn't disconnect)


    Naturally I wouldn't expect the actual literal character-for-character
    solution to copy-and-paste into the OP's scenario, but that link and others
    like it from the suggested search seem like reasonable jumping-off points to
    me. It's certainly how I'd go about researching this question were I facing
    it in my own work.

    How would you do it?

    --
    Lew
    Ceci n'est pas une pipe.
     
    Lew, Dec 29, 2010
    #6
  7. On 28-12-2010 22:15, Lew wrote:
    > On 12/28/2010 08:55 PM,
    > Lew wrote:
    >>> I am not clear what the antecedent for "it" is in that sentence. Do you
    >>> mean the links that result from that search?

    >
    > Arne Vajhøj wrote:
    >> Yes.
    >>
    >>> I pursued several and they
    >>> do bear on the OP's question, many of them.

    >
    > Arne Vajhøj wrote:
    >> I tried the first 10 links and as far as I can tell they do not
    >> provide a solution for the question asked.
    >>
    >> What link do you think provide a solution?

    >
    > Ahem. I didn't say "provide a solution", I said "bear on the ... question".


    > http://objectmix.com/weblogic/573926-setting-timeout-web-service-client.html


    > was one that discussed timing out without mentioning that it was a
    > connection timeout but a read timeout. Without doing the deeper research
    > I trust the OP will have done by now, I cannot say how much that
    > information translates to the OP's question:


    That uses a WebLogic specific method to set a timeout in JAX-RPC,
    which is different from the JAX-WS API that the question is about.

    > Naturally I wouldn't expect the actual literal character-for-character
    > solution to copy-and-paste into the OP's scenario,


    Neither would I.

    But maybe something that at least used the same framework as
    the OP!

    > but that link and
    > others like it from the suggested search seem like reasonable
    > jumping-off points to me. It's certainly how I'd go about researching
    > this question were I facing it in my own work.
    >
    > How would you do it?


    Google a lot.

    Maybe ask in a forum for help.

    Be extremely irritated over LMGTFY replies that does
    not lead to a solution.

    Arne
     
    Arne Vajhøj, Dec 29, 2010
    #7
  8. "Ale" <> wrote in message
    news:...
    > Hello,
    >
    > I've a client calling a web service method (using JAX-WS), which
    > randomically doesn't receive any answer or error, or exception, so
    > that client waits forever without dying.
    >
    > I can't touch the web service code, but I can add a client timeout;
    > the issue is that using these props
    >
    > System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
    > System.setProperty("sun.net.client.defaultReadTimeout", "300000");
    >
    > it doesn't work because they only deal with network connection (which
    > of course doesn't disconnect)


    The second of these sets a read timeout, which is exactly what you want: to
    time out when the client is trying to read the response from the server.
    However, it's a timeout for a specific client implementation. According to
    http://download.oracle.com/javase/1.4.2/docs/guide/net/properties.html, it's
    " for the protocol handler used by java.net.URLConnection." It also says
    "These properties may not be supported in future releases.", and that is a
    1.4.2-specific page. (I can't find a newer page describing this property.)
    What you need to find out is how to set a read timeout for the network
    library that your client is using.



    >
    > Any suggestion ?
    >
    > Thanks a lot,
    > Ale
     
    Mike Schilling, Dec 29, 2010
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page