[jboss-user] [JBossWS] - wssecurity client threadsafety question

KickMeToAndy do-not-reply at jboss.com
Tue Sep 9 11:23:32 EDT 2008


we are using ws security (UsernameTokenProfile) with our JBoss server. The Client is a multithreaded web application. For each web service call we have to add the logged in users credentials to the webservice so we can pass the authentication at the server.  The client code looks like : 

  |  TestWebservice_Service service = new TestWebservice_Service();
  |  TestWebservice port = service.getPort(TestWebservice.class);
  |         ((StubExt) port).setConfigName("Standard WSSecurity Client");
  |         ((StubExt) port).setSecurityConfig("jboss-wsse-client.xml");
  |         ((BindingProvider) port).getRequestContext().put(StubExt.PROPERTY_AUTH_TYPE, StubExt.PROPERTY_AUTH_TYPE_WSSE);
  |         ((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "user");
  |         ((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
  |                 "pwd");

I was wondering i a have to create a new port for each client call or if
it is possible to share one for all the thread, because the creation of the
port is quite expensive (and we are using spring to create the client service class). the only difference between the calls is the
different content in the RequestContext map, due to the differen users.
As far as i can tell the RequestContext is not ThreadSafe thus i have to
create a new Port for each call. can anybody confirm this ?

thanks in advance,

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175343#4175343

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175343

More information about the jboss-user mailing list