[jboss-user] [JBossWS] - Re: Are ports reusable/concurrent?
jorgemoralespou_2
do-not-reply at jboss.com
Thu Oct 2 06:24:41 EDT 2008
We have done this:
| // Static initialization of webservice client
| static protected SendSms stub;
|
| static{
| QName qname = new QName(
| "http://www.csapi.org/wsdl/parlayx/sms/send/v2_2/service",
| "SendSms");
| SendSmsService service = new SendSmsService(null, qname);
| stub = service.getSendSms();
| }
|
|
| @Override
| protected String sendMessage(...params...) throws Exception {
| String response = null;
|
| if (stub==null){
| throw new Exception("There is no stub for SendSms PX 2.1 service created.");
| }
|
| //Configure stub
| stub.getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT,1000);
| stub.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, ...);
| response = stub.sendSms(...params....);
| return response;
| }
|
|
But I doing tests to see if it is ThreadSafe to do this, or configuring an endpoint on the stub, will afect other clients sending messages to a previously configured stub in a previous (but concurrent) call.
In this cases I see that Stub generation only happens in the static initialization, and this way, performance is much more better.
Am I doing something wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4179980#4179980
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4179980
More information about the jboss-user
mailing list