Hi Ken,

To make this property thread safe, it is enough to activate thread local in 
request context:

(BindingProvider)proxy).getRequestContext().put("thread.local.request.context", 
"true").

After that you can set different endpoints for the same proxy in different 
threads.

Regards,
Andrei.


From: Ken Hancock [mailto:[email protected]]
Sent: Dienstag, 24. Oktober 2017 04:58
To: Andrei Shakirin
Subject: Re: Dynamically changing endpoints

Andrei,
Won't BindingProvider.ENDPOINT_ADDRESS_PROPERTY set it globally for the entire 
service?  That's not on a message-per-message basis, is it?


On Mon, Oct 23, 2017 at 4:55 PM, Andrei Shakirin 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

One option is set BindingProvider.ENDPOINT_ADDRESS_PROPERTY in request context:

        final Greeter port = service.getGreeterPort();
        BindingProvider provider = (BindingProvider)port;
        
provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,  
address);

Regards,
Andrei.

> -----Original Message-----
> From: Ken Hancock [mailto:[email protected]<mailto:[email protected]>]
> Sent: Mittwoch, 18. Oktober 2017 16:31
> To: [email protected]<mailto:[email protected]>
> Subject: Dynamically changing endpoints
>
> I'm implementing a client for a soap endpoint where the messages return
> different callouts to be used for individual soap operations, each endpoint
> supporting the same service wsdl.  Does anyone have suggestions on the best
> way to change the endpoint for different soap operations?
>
> I could create a separate proxy for each operation, but that seems 
> particularly
> slow and heavyweight.

Reply via email to