Hmm, sorry, I forgot to mention that the web services had been configured in "soapsession" scope (in the services.xml file)...
Benoît Selon Michele Mazzucco <[EMAIL PROTECTED]>: > Benoît, > > > my guess is that the service must be configured in session scope. > > > Michele > > On 18 Feb 2008, at 08:38, Benoît Smith wrote: > > > Greetings, > > > > I'm a clear newbie to Axis2, and I'm aware that the question I'm > > asking has > > already been asked in many forms before. The thing is, none of the > > solutions > > appeared to solve my specific problem. So I'll try to be as > > accurate as > > possible. > > > > My objectives : > > Run some Axis2 web services on a Tomcat servlet container, and > > access them with > > a *remote* client, using session management. > > > > Server-side configuration : > > - Axis2 1.2 (for compatibility reasons, I have to stick with 1.2), > > installed as > > a component on a Tomcat 6.0.14 servlet container. > > - axis2.xml configured by default. The Addressing module seems well > > engaged. > > - The SampleService I wrote includes a 'sessionId' value in its > > responses. That > > value contains the result for sc.getServiceGroupContext().getId(), > > which is - I > > think - the value I should keep for session management. > > - I can access the autogenerated WSDL through an URL like: > > http://www.mydomain.com:8080/axis2/sampleService?wsdl > > > > Client-side configuration : > > - A standalone client based on Axis2 1.2. > > - Stubs are generated with the following command : > > WSDL2Java.main( > > new String[] { > > "-uri", > > "http://www.mydomain.com:8080/axis2/sampleService?wsdl", > > "-o", "/some/output/path", > > "-p", "fr.axis2ws.test.stubs" > > } > > ); > > - The test client sends ten requests to the service. At each loop, > > it tries to > > retrieve the 'sessionId' value from the response, then reinsert it > > in the header > > of the next request. Here is the source code : > > public static void main (String args[]) throws Exception { > > String idSession = null; > > for (int i = 0; i < 10; i++) { > > SampleServicesampleServiceHttpportStub stub = new > > SampleServicesampleServiceHttpportStub(); > > stub._getServiceClient().getOptions().setManageSession > > (true); > > > > stub._getServiceClient().getOptions().setProperty > > (AddressingConstants.WS_ADDRESSING_VERSION, > > AddressingConstants.Final.WSA_NAMESPACE); > > stub._getServiceClient().engageModule > > (Constants.MODULE_ADDRESSING); > > if (idSession != null) { > > stub._getServiceClient() > > .setTargetEPR(new > > EndpointReference("http://www.mydomain.com:8080/axis2/ > > sampleService")); > > stub._getServiceClient() > > .addStringHeader( > > new QName( > > Constants.AXIS2_NAMESPACE_URI > > , Constants.SERVICE_GROUP_ID > > , Constants.AXIS2_NAMESPACE_PREFIX > > ) > > , idSession > > ); > > } > > GetResult gr = new GetResult(); > > gr.setParam(-1); > > GetResultResponse reponse = stub.getResult(gr); > > idSession = reponse.get_return().getIdSession(); > > } > > } > > > > I trust you probably guessed the result already - the tests failed. > > Somewhere > > along the way, the 'sessionId' value is lost, so the service > > returns a new one, > > which makes session management impossible. > > > > I'm pretty sure I'm missing something, but so far, I failed to see > > what. Any > > help will be greatly appreciated. Thank you ! > > > > Best regards, > > Benoît Smith --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]