In my previous blog post I explained how to explore a WSO2 Carbon admin Webservice, here I'm going to access an admin web service by providing authentication details.
I assume you are in the 3rd step of my previous example and able to list all admin services using OSGI console command listAdminServices.
If you able to access https://localhost:9443/services/UserAdmin?wsdl you are good to move further in this post.
1. Open new SoapUI project, lets name it UserAdmin provide above URL as the initial WSDL and press ok.
You will see all available SOAP requests under "UserAdmin" webservice.
You will get the SOAP request generated by SoapUI with the use of provided WSDL.
3. Click on the Aut button under the request tab select authorization type as preemptive.
4. Provide admin username and password of your carbon instance.
5. Send SOAP request.
If you have done everything right you will get the list of available roles in your carbon server.
Further I will explain how to use the already generated Set-Cookie: JSESSIONID to authenticate next requests rather than providing username & password again.
Lets view raw response in our previous step, by pressing raw tab inside response window.You will see HTTP header details,
HTTP/1.1 200 OKI'm going to send a getRolesOfUser SOAP request with the use of available Cookie: JSESSIONID=D9A45BE1CCD7616F88FDF4E0FF85C213.
Set-Cookie: JSESSIONID=D9A45BE1CCD7616F88FDF4E0FF85C213; Path=/; Secure; HttpOnly
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 03 Dec 2013 10:40:15 GMT
Server: WSO2 Carbon Server
Click Headers tab under the request window and enter "Header" name as Cookie and "Value" as JSESSIONID=D9A45BE1CCD7616F88FDF4E0FF85C213.
Refer following screen-shot,
Here I'm trying to list down all available roles for the given user, in my case it's me "udara" ;) .
You will see some similar response,
No comments:
Post a Comment