users@jax-ws.java.net

Re: JAX-WS General usage questions

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Wed, 08 Feb 2006 09:59:25 -0800

I will let the users of JAX-WS respond to this.

Olano, Ever wrote:

>Thanks. Follow-up question. Even if the stubs are thread-safe, do
>people normally keep just one instance and use it for all remote calls
>or is the standard practice to create one each time (or at least one per
>thread)?
>
>Thanks, Doug. You're one of the people who had also been answering my
>questions on the forums. Thanks!!!
>
>Ever
>
>-----Original Message-----
>From: Doug Kohlert [mailto:Doug.Kohlert_at_Sun.COM]
>Sent: Tuesday, February 07, 2006 10:31 AM
>To: users_at_jax-ws.dev.java.net
>Subject: Re: JAX-WS General usage questions
>
>
>
>Olano, Ever wrote:
>
>
>
>>Hello. I am writing a sample client using JAX-WS 2.0 that will consume
>>
>>
>
>
>
>>our own web service. With the help of a couple of people on the Sun
>>forums, I was able to get as far as sending a request and getting a
>>fault (I have yet to sign my request as required by our web service).
>>
>>My questions are:
>>
>> 1. Is there a way to set the timeout (for waiting for the
>> response)? How?
>>
>>
>>
>Yes, there is a new property on BindingProvider that you can use to set
>the timeout, the value is an Integer specified in
>milliseconds
>//Dispatch
>dispatch.getRequestContext().put("com.sun.xml.ws.request.timeout", new
>Integer(5000));
>//proxy
>(
>(BindingProvider)proxy).getRequestContext().put("com.sun.xml.ws.request.
>timeout",
>new Integer(5000));
>
>
>
>> 1.
>>
>>
>> 2. When I get a WebServiceException (that is not a
>> SOAPFaultException), is there a way to tell when (i.e. which
>> stage) the exception occurred, specifically, whether or not the
>> exception occurred while waiting for the reply (e.g. timeout)?
>> Or do I just call the exception's getCause() method and infer
>> from the type of exception that it returns.
>>
>>
>>
>No
>
>
>
>> 2.
>>
>>
>> 3. Is the Service-derived class generated by wsimport thread-safe?
>> Can I use just a single instance and call its getPort*() method
>> for each request? (I'm guessing yes.)
>>
>>
>>
>Yes
>
>
>
>> 4. What about each stub/port object? Is it thread-safe? (I'm
>> guessing no.)
>>
>>
>>
>Yes
>
>
>
>>Thanks in advance for your help.
>>
>>Ever
>>
>>
>>
>
>
>

-- 
 - Doug