Creating SOAP API Method in Opkey



SOAP (Simple Object Access Protocol) is a messaging protocol that allows two applications to communicate with each other over a network using XML messages. 


In Opkey, you can create test cases for both SOAP and REST APIs. To ensure reusability in such test cases, Opkey provides service repositories that can store methods for testing APIs and can be reused across test cases. 


In the following sections, we will understand the process of creating a SOAP API test case. Here, we will use the example of a SOAP service that converts Celsius to Fahrenheit.


1. Hover over the Automate section and click the API Test category. 

 

2. Now, click the Create API Test button to open the Create ApiTest window. 


In this window, add a name, select priority, choose an assignee, and add a description. Once done, click the Create button at the bottom.



3.  Now, you will get an option to choose the service type. Select the SOAP service button as shown below. 




4. Enter a valid URL in the API Endpoint text box. For example - we are using the URL 

https://www.w3schools.com/xml/tempconvert.asmx?op=FahrenheitToCelsius

You may also need to provide authentication details (from the Authentication type dropdown) if it’s required by the SOAP web service.


NoteSSL (Secure Sockets Layer) ensures secure, encrypted communication between a website and a web browser. However, some websites may lack SSL or TLS security certificates.

When using the Service Repository in Opkey One for such sites, you can bypass SSL/TLS errors by going to the settings tab and disabling the "Ignore SSL/TLS Error" option. This will disregard all SSL/TLS-related errors.


5. Now, you need to add a new method to the added Soap service. Click on the Add Method icon on the left as shown below.


6. Go to the XML Parameter tab and click on Add From XML icon.

 

7. A new popup window will open to add XML data. 


8. Now go to the URL 

https://www.w3schools.com/xml/tempconvert.asmx?op=FahrenheitToCelsius

and copy the requested XML data.



9. Paste the copied XML in the Add from XML window and click the Save button.

Added Soap XML gets broken down into input parameters. You can edit input parameter values as required. 



11. Now, you can go to the Header Parameter tab if you want to add the required header parameters. Click the icon to add a new parameter with input arguments and description. Make sure to check the IsArgument checkbox. 

Note: Adding new Input Parameters and providing names, values, etc. depends on the SOAP Web Service. In our SOAP service example, headers are not required.


12. After this, you can click the Save button at the top-right corner to save your SOAP Service Repository file.

13. Now, let’s test the SOAP API service we have created. Go to the XML parameter tab and provide a default value in the last row. Make sure that the last row is checked.  After adding the value, click the Send button. Here, we have added 20 as the default value.


14. After clicking the Send button, you will receive a response under the Request Data tab. The response contains a Status shown as “200 OK” which means that the API call was successful. You can also see the Fahrenheit value 20 converted to Celsius value -6.66666666666667. 


You've reached the end of this article and are now well-prepared to create SOAP API tests. 

Explore, experiment, and achieve your testing goals with Opkey!

Ready to dive deeper? Check out the next article: REST API Test.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article