Question

I m working on wso2 admin services. I get url as http://localhost:9763/services/AuthenticationAdmin?wsdl for AuthencticationAdmin.

Now, when I hit the login operation, with admin,admin,127.0.0.1, I get true as return.

ESB console shows logged in.

Now, when I hit logout operation, I dont get any response.

Also I notice that header of the response does not contain any session ID.

My ESB is 4.6.0.

login request :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://authentication.services.core.carbon.wso2.org">
   <soapenv:Header/>
   <soapenv:Body>
      <aut:login>
         <!--Optional:-->
         <aut:username>admin</aut:username>
         <!--Optional:-->
         <aut:password>admin</aut:password>
         <!--Optional:-->
         <aut:remoteAddress>127.0.0.1</aut:remoteAddress>
      </aut:login>
   </soapenv:Body>
</soapenv:Envelope>

login response :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:loginResponse xmlns:ns="http://authentication.services.core.carbon.wso2.org">
         <ns:return>true</ns:return>
      </ns:loginResponse>
   </soapenv:Body>
</soapenv:Envelope>

In the response, when I hit login I see, at bottom I only get 6 elements in header as follows :

> Date Tue, 25 Jun 2013 14:31:42 GMT
> Transfer-Encoding chunked
> #status# HTTP/1.1 200 OK
> Content-Type text/xml; charset=UTF-8
> Connection Keep-Alive
> Server WSO2-PassThrough-HTTP

Now, I dont get session ID. Can you please point out where m I going wrong?

My scenario is that I want to login to WSO2 and then hit some other admin service operation.

Was it helpful?

Solution

After some time debugging with the java client (see my other answer), I noticed that the SOAPUI Endpoint was not using the 9443 port that I was using in the Java client. See the image below.

enter image description here

The 8243 port was picked up from the WSDL by SOAPUI.

When I changed the SOAP UI Endpoint port from 8243 to 9443, the JSESSIONID gets returned in the response, as seen below:

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=573D42750DE6C0A287E1582239EB5847; Path=/; Secure; HttpOnly
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 26 Jun 2013 22:14:20 GMT
Server: WSO2 Carbon Server

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:loginResponse xmlns:ns="http://authentication.services.core.carbon.wso2.org"><ns:return>true</ns:return></ns:loginResponse></soapenv:Body></soapenv:Envelope>

I have no idea what the difference is between the ports 8243 and 9443, or why one returns a JSESSIONID and the other doesn't.

OTHER TIPS

You could try accessing the server using a java client. There is an example here. You could try this example and dump out the SOAP message to see the difference against what you are seeing in SOAPUI.

I'm wondering if the example axis client's setManageSession(true) does some magic on the session:

public static void main(String[] args) throws 
            RemoteException, AuthenticationAdminAuthenticationExceptionException {

    System.setProperty("javax.net.ssl.trustStore", 
                        SampleConstants.CLIENT_TRUST_STORE_PATH);
    System.setProperty("javax.net.ssl.trustStorePassword", 
                        SampleConstants.KEY_STORE_PASSWORD);
    System.setProperty("javax.net.ssl.trustStoreType", 
                        SampleConstants.KEY_STORE_TYPE);

    AuthenticationAdminStub stub = 
          new AuthenticationAdminStub(
                 "https://localhost:9443/services/AuthenticationAdmin");
    ServiceClient client = stub._getServiceClient();
    Options options = client.getOptions();
    options.setManageSession(true);

    Login login = new Login();
    login.setUsername("admin");
    login.setPassword("admin");
    stub.login(login);

    ServiceContext serviceContext = stub.
            _getServiceClient().getLastOperationContext().getServiceContext();
    String sessionCookie = (String) serviceContext
                               .getProperty(HTTPConstants.COOKIE_STRING);

    System.out.println(sessionCookie);      
}

The above code prints out something similar to the following:

JSESSIONID=844ECBED015805A24FF9DBD5F5A56C8D; Path=/; Secure=null; HttpOnly=null

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top