Tuesday, October 16, 2012

How to invoke Admin Services with SoapUI

It is very very easy to invoke WSO2 Carbon Admin Services with SOAP UI.

Step 1. 
Use the AuthenticationAdmin Service to obtain the session cookie.
You can access the AuthenticationAdmin WSDL of a carbon server with the following url assuming that the server is running with default ports.


SOAP SoapUI to generate the Client for it.
Now invoke the login method. A sample request would be like

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:aut="http://authentication.services.core.carbon.wso2.org">

In the response message, an HTTP Header will be available with a session cookie.

HTTP/1.1 200 OK

Set-Cookie: JSESSIONID=2671C3A974C0FE67BD9D1DDF665E1DC3; Path=/; Secure; HttpOnly
Content-Type: application/soap+xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 16 Oct 2012 18:48:33 GMT
Server: WSO2 Carbon Server

Step 2.

Now when invoking any other admin service, add the http header COOKIE from soap UI.

A sample request message would look like 

POST http://localhost:9763/services/ProcessManagementService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:getProcessInfo"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:9763
Content-Length: 571

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<ns1:getProcessInfoIn xmlns:ns1="http://wso2.org/bps/management/schema">
<ns1:pid xmlns:s13="http://ode/bpel/unit-test">s13:HelloWorld2-2</ns1:pid>


  1. Hi Nandika,

    Your post was of a great help to me.
    Was struggling to find an example on using cookies as headers


  2. You can also use the basic auth headers to invoke the admin services. If you are using soap ui, you can set the username and password and then it will work fine.

  3. Hi,

    I m trying to invoke the service AuthenticationAdmin via SOAP UI... when I hit login, I pass admin,admin,

    In the response, when 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?

    Also, as you mentioned about second service at port 9763, only services at this port can be accessed?

    Please help.

    Thanks and Regards,

  4. Thanks for sharing the information. SoapUI is the open source web service testing tool, it can test both SOAP and REST Web services with specific steps to request SOAP and REST request. Lead online training provides best SOAP UI TESTING ONLINE TRAINING

  5. Thanks for sharing these information. It’s a very nice topic. We are providing online training classes soapuionlinetraining

  6. Nandika,

    What is the minimum role that the user needs to be assigned to able to authenticate using the AuthenticationAdmin WS?