I'm a bit confused now, or maybe you thought that I'm speaking of server side, while I'm talking about client stubs ... Maybe you can help me through this example.
Let's say generated client stub that implements MyServicePort that exposes all needed remote actions can be instantiated like this : Stub stub = new SoapMyServiceBindingStub(portAddress, null); Problem is that I cannot use this class above as client singleton (by whatever means of instantiating it - Spring way is popular currently) and to be used shared for all users of my web application, since class above requires username/password set beforehand like : stub.setUsername(username); stub.setPassword(username); before calling any remote action (exposed in MyServicePort interface). And now comes the problem - if simultaneous users use my web application, and want to execute some remote actions using this shared client stub, that means that they have to set this username/password on this same instance, thus making it unusable for simultaneous usage. Am I right ? -Vjeran ----- Original Message ----- From: "Martin Olsson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 22, 2004 10:20 AM Subject: Re: Client stub as singleton service impossible? > > You need to set the scope parameter to "application" in your deployment > descriptor, this will force Axis to create just one instance of your web > services class and then reuse this instance for all additional users. > > > regards, > martin olsson > > > Vjeran Marcinko wrote: > > Hi folks. > > > > I'm using Axis 1.1 client stub generated by WSDL2Java ant task. I'm pretty > > happy about it, but there is one problem. > > My web application serves for many users to log in and perform some actions > > on remote SOAP service, and I would like this client stub to be singleton > > service exposing these remote actions. Problem is that each user of my > > application has (as normal) different username/password, that is mapped to > > SOAP username/passwords sent inside SOAP request by this client stub, but > > since this username/password is suposed to be set on client stub before > > calling remote actions (thus SOAP login is sent during each forecoming > > requests), that practicaly forces me to use separate stubs for each user of > > my webapp, and not one mutual singleton stub per application as desired? > > > > Has anyone experiences similar requirement, and solved it somehow ? > > > > Regards, > > Vjeran > >