You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Va...@keybank.com on 2007/08/20 21:47:55 UTC

Problem maintaining the session


I want to use AXIS2 to connect to a service that needs to maintain session.
I am able to maintain session if I use AXIS 1.4, but when I try using AXIS2
1.1.1, the session is not maintained. Here's the code that is not working
with AXIS2:

            MyServicesWSServiceStub stub = new MyServicesWSServiceStub(
"https://service.address/webservices/MyServicesWS");
            Options options = stub._getServiceClient().getOptions();

            HttpTransportProperties.ProxyProperties proxyProperties = new
HttpTransportProperties.ProxyProperties();
            proxyProperties.setProxyName("firewall.location.com");
            proxyProperties.setProxyPort(80);

options.setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY,
proxyProperties);
            options.setProperty(HTTPConstants.HEADER_CONNECTION,
HTTPConstants.HEADER_CONNECTION_KEEPALIVE);
            options.setManageSession(true);
            LoginDocument loginDocument = LoginDocument.Factory.newInstance
();
            Login login = loginDocument.addNewLogin();
            login.setPassword("mypassword");
            login.setUsername("myuser");
            LoginResponseDocument loginResponse =
stub.login(loginDocument);
            LogoutDocument logoutDocument = LogoutDocument.Factory.
newInstance();
            logoutDocument.addNewLogout();
            LogoutResponseDocument response2 = stub.logout(logoutDocument);

When I get to executing stub.logout(), I get AxisFault, indicating that the
I am not logged in.
As I said before, corresponding code in AXIS 1.4 is working properly.

Vadim



*******************************************************************************
This communication may contain privileged and/or confidential information. It
is intended solely for the use of the addressee. If you are not the intended
recipient, you are strictly prohibited from disclosing, copying, distributing
or using any of this information. If you received this communication in error,
please contact the sender immediately and destroy the material in its entirety,
whether electronic or hard copy. This communication may contain nonpublic personal
information about consumers subject to the restrictions of the 
Gramm-Leach-Bliley Act. You may not directly or indirectly reuse or redisclose
such information for any purpose other than to provide the services for which
you are receiving the information.

127 Public Square, Cleveland, OH 44114
*******************************************************************************


If you prefer not to receive future e-mail offers for products or services from
Key send an e-mail to DNERequests@key.com with 'No Promotional E-mails' in the
SUBJECT line.