Hi,
You can take a look into NTLM with HttpAsyncClient
https://cwiki.apache.org/confluence/display/CXF20DOC/Asynchronous+Client+HTTP+Transport.
I am not absolutely sure that you can share the same client proxy with
different threads by using this code:
(BindingProvider)proxy).getRequestContext().put("thread.local.request.context",
"true")
...
Credentials creds = new NTCredentials("username", "pswd", null, "domain");
bp.getRequestContext().put(Credentials.class.getName(), creds);
// make client proxy call
If it doesn't work, perhaps the solution is to create client proxy per thread.
Regards,
Andrei.
> -----Original Message-----
> From: Samo Dadela [mailto:[email protected]]
> Sent: Freitag, 8. November 2013 15:57
> To: [email protected]
> Subject: multiple WS calls to the same URL as different user from same VM
>
> Hi,
>
> Searched long and wide but can't find anything on the issue... Using JDK 6.
>
> I've generated a JAX-WS client proxy using wsdl2java using Lists.wdsl
> (SharePoint). I can authenticate via NTLM without problem by passing the
> credentials via java.net.Auhtenticator (setDefault)...
>
> What I want to do is to call the same webservice method from different
> threads (concurrently) but each call has to be authenticated as a different
> user. How can this be done? I don't know how to specify different
> credentials for each call.
>
> A code example would be appreciated.
>
> Best regards,
>
> Samo
>
>