The Web Services play a vital role in Salesforce development. After developing these Web Services, it is important to properly test whether the services are working fine or not.
SOAPUI is one of the open source cross-platform API Testing tool. It allows users to execute automated functional, regression, compliance, and load tests on different Web API.
SOAPUI supports all the standard protocols and technologies to test all kinds of APIs. We can test both Web Service (SOAP) and Web API (REST) and the standard and custom web services using SOAPUI.
Let us see how to use the SOAPUI to test the salesforce WSDL. First, we need to get Enterprise WSDL from Salesforce. It allows you to easily integrate Salesforce.com with your applications
Log into Salesforce and go to Setup -> Enter API in quick find box->click Enterprise WSDL -> click ‘Generate WSDL’ button and save it.
Download the SOAPUI and install it.
Open the SOAPUI. Go to File -> select New SOAP Project
Step – 3:
Enter name and select the generated WSDL file and click Ok.
After clicking ok, the project name (SOAPAPI) folder appears in the navigator panel on the left side of the screen. Here, you can see all the available methods in the web service.
Step – 5:
Expand the Login Method and click on the soap request under Login Folder. Then, you can see the sample SOAP login request format in the screen as below
In this example the Endpoint URL is https://login.salesforce.com/services/Soap/c/39.0/0DF28000000fyF3
- https://—States secures HTTP.
- login.salesforce.com—Top-level domain for a login request.
- /services/Soap—states that we’re making a SOAP API request.
- /c—states that we’re using the enterprise WSDL. Use /u for the partner WSDL.
- /39.0—API version number
- / 0DF28000000fyF3—Package version number.
Click the Submit request button at the left corner in the request window.
For accessing other methods in Salesforce, we need to use the server Url and sessionID in the response section.
External web service WSDL
Likewise, you can also test the external SOAP Web services, which we are going to use in our Salesforce development. Look at the below example
Here, we can see how to use some external web service to get the list of cities for a country name. Get the WSDL from here and follow the steps 2 & 3
To the list of cities, type country name in request section and click the Request Submit button. Then, the response appears in the right-side response section.
In the same method, you can test other standard and custom WSDL using SOAPUI.
SOAPUI is a tool with simple User Interface which makes both technical and non-technical users to test web services easily. SOAPUI also provides ‘Logs panel’ and it has the complete information regarding the transaction between the client and the server.