Question & Answer
Question
I want to test the WebAPI to ensure I get expected responses from the WebAPI operations. How do I do this using SOAPUI?
Answer
Using SOAPUI, you can follow these steps to gain access to the methods available in your Teamworks/WebSphere Lombardi Edition installation.
SETUP
- Download and install SOAPUI
- Start a "New SOAPUI Project"
- Project Name: WebAPI test -- NOTE: this can be anything you like
- Initial WSDL/WADL: http://<SERVER>:<PORT>/webapi/services/WebAPIService?wsdl
- Click "OK"
- This will now prompt you for Basic Authentication. Use tw_admin with the corresponding password for this and click "OK"
- Now, you will see a list of methods you can choose from to interact with and test.
TESTING A WEBAPI CALL
- In this example, I will use the GetAllRoles method.
- Right click on the "GetAllRoles" and select "New Request".
- Specify the name of the request or take the default name.
- Once the request editor is up, you will need to change the information that has a question mark to valid info. Some items are optional and you can delete them. This will vary between operations, so you should check the WebAPI documentation for that specific operation.
- Looking at the initial request for the "GetAllRoles" we see this:
- And we then change it to be this:
- Once the request is ready, we need to specify the authentication. At the bottom of the request box is a "Aut" button. Click on that and set the Username and Password to tw_admin with the corresponding password.
- We can now click the green arrow "Run" button and get a response from the server.
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webapi.lombardisoftware.com">
<soapenv:Header>
<web:ClientInfo>
<web:TimeZone>?</web:TimeZone>
<web:Locale>?</web:Locale>
<web:AcceptsTimeZone>?</web:AcceptsTimeZone>
<!--Optional:-->
<web:Version>?</web:Version>
<!--Optional:-->
<web:SafelyIgnoresExtraXml>?</web:SafelyIgnoresExtraXml>
</web:ClientInfo>
</soapenv:Header>
<soapenv:Body>
<web:GetAllRoles/>
</soapenv:Body>
</soapenv:Envelope>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webapi.lombardisoftware.com">
<soapenv:Header>
<web:ClientInfo>
<web:TimeZone>CST</web:TimeZone>
<web:Locale>EN</web:Locale>
<web:AcceptsTimeZone>false</web:AcceptsTimeZone>
</web:ClientInfo>
</soapenv:Header>
<soapenv:Body>
<web:GetAllRoles/>
</soapenv:Body>
</soapenv:Envelope>
You can use this method to test out other WebAPI operations as well.
[{"Product":{"code":"SSFPRP","label":"WebSphere Lombardi Edition"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Web API","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.1;7.0.1;6.2.2;6.2.1;6.2","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}}]
Product Synonym
WLE
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21444296