Try this: Bean1ServicePortType stub = null; ...................
stub = new Bean1ServiceLocator().getBean1ServicePort(); // SET SESSION FOR THIS WEB SERVICE ((Bean1ServicePortSoapBindingStub) stub).setMaintainSession(true); stub.setSample(jTextField1.getText()); This works for me. I get it by myself in 3 sleepless nights! Tell me if this work for you!!! Hope it helps! > For me, the code from SessionTest was not of any help :o((( > > This happened in my own case. getCurrentContext() returns null when running > axis as a client. Have no idea why... maybe because I did not supply an wsdd > client file ?!?!? > > IN order to enable session tracking, I have done the following: > > My service (server) is scope="Application" (don't want a session scope). > > I have an entry method for my service, called "Login". When you connect from > client to service by calling login method, the service gives you a Cookie. > (Set Cookie:blah blah blah; /axis). You have to keep this cookie on client > and all the calls that you will make to the server should contain the coockie. > > Here comes the bad part: On client, I create ca Session().createCall(). Set > the call to Login method. set the call.setMantainSession( true ) (something > like this) and call the login. > > Then, whatever call I am going to make, I am going to use the same Call > object wich I have used for login. The call object keeps the cookie and sends > it all the time you ask for a method. > > What I don't like is that I have to keep the same Call object, and this seems > not to be normal. But if I try to create a new Call object, I don't know how > to obtain the session id from the old one and how to set it on the now one??? > > Hope it helps, > dovle
