Monday, February 9, 2015

SOAPUI - Test WSDL of the Admin Service - HTTP 401 Unauthorized

I'm currently trying to test WSDL of the Admin Service of WSO2 Identity Server 5.0.0 via SOAPUI 5.0.0

I followed the documentation [1] and [2].

I have set the <HideAdminServiceWSDLs> element to false in <IS_HOME>/repository/conf/carbon.xml file and started the IS server.

In SOAPUI, after creating a project by giving WSDL url as per [1], I tried to invoke addUser().

There, I got the following error as the response.
HTTP/1.1 401 Unauthorized
Set-Cookie: JSESSIONID=9F134766CCA3D8AD2C495678A71FF1FC; Path=/; Secure; HttpOnly
Server: WSO2 Carbon Server
Date: Mon, 09 Feb 2015 09:00:21 GMT
WWW-Authenticate: Basic realm="WSO2 Identity Server"
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Content-Encoding: gzip
Vary: Accept-Encoding

Solution is as follows [refer below image].

1. Click on the Auth icon just below the soap request, then click on "Add new Authorization"
2. In add authorization dialog box select Basic as type.
3. Now enter authentication credentials(e.g.: admin:admin), and select "authenticate pre-emptively" radio button.



After resending the SOAP request, HTTP Accepted response received.
HTTP/1.1 202 Accepted
Set-Cookie: JSESSIONID=EE298AD95DC943C70C01757ABA545DE8; Path=/; Secure; HttpOnly
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 09 Feb 2015 09:28:12 GMT
Server: WSO2 Carbon Server


Reference:
[1] https://docs.wso2.com/display/IS500/Managing+Users+and+Roles+with+APIs
[2] https://docs.wso2.com/display/Carbon420/Calling+Admin+Services+from+Apps