Fetching data from SOAP Web services

Nikhil Das Nomula

soap-api-web-services

One of the fundamental things in business intelligence and data science is to fetch the data from a source. Most of the time companies expose their data through an API(Application Programming Interface) or a web service. In this article, we will demonstrate how to call a SOAP web service using POSTMAN.

SOAP stands for Simple Object Access Protocol and it is one of the standards for web services. SOAP exclusively uses XML for exchange of data and one of the things that you would need to call a SOAP web service is the wsdl file. This is the file that tells you the definition of the web service and what services it offers.

Although the wsdl file gives you information of the web service, it is not in a human readable manner. One of the main drawbacks with SOAP web services is that the XML that is interchanged can get really complex. Languages like .NET and Java have libraries to parse these into objects, however they are not as simple as a REST web service where you get back a JSON(most of the time) and you can use any python, R library to do further data processing with that.

Now lets get into getting data from these web services. The software that you need to call these web services is called Postman. You can download it here. We don't necessarily fetch the data all the time when calling a SOAP web service, but as we are talking in the context of business intelligence and data science, we are calling its as fetching data from a SOAP web service.

Calling a SOAP Web Service:

Let's start with a SOAP webservice that gets the list of all countries. For any web service, the web service provider will provide you with the documentation or the wsdl file that describes that the web service does. From this you extract two pieces of information

  1. Url(or Endpoint)
  2. Request body.

Once you get that information, here is how you enter these details in POSTMAN

  • Create a new request and select the type as 'POST'
  • Enter the soap endpoint url
  • In the headers tab enter the Content-TYpe as application/soap-xml. If the URL is secure, which in most cases it would be if you can select the Authorization tab to enter the user name and password for Basic Authentication.

At this point your POSTMAN request should look like the following

Now click on the 'Body' Type and enter the request body. Make sure you select 'raw' checkbox . At this point your POSTMAN should look like this

Once you hit the "Send" button, you should see the response below as shown. The response gives us '200 OK' which means the request was successful. And in this particular case we got the list of all countries.

That's it! You can now "Save Response". Now you can use this response to do further data processing.

If you have any questions regarding calling SOAP web services, or if you want to write your own SOAP web services, feel free to get in touch with us at contact@yajur.tech

You Might Also Like

Platform Engineering and DevEx(DX) — Why it matters?
Platform Engineering and DevEx(DX) — Why it matters?

Platform engineering is not a new thing anymore and it is great that companies have started to adopt it. However, there are still some questions

Read More
Fetching data from SOAP Web services
Fetching data from SOAP Web services

One of the fundamental things in business intelligence and data science is to fetch the data from a source. Most of the time companies expose their data

Read More
Javascript and its eco system
Javascript and its eco system

Javascript is a dynamically typed, interpreted programming language. In simple words, it is a language where you do not explicitly mention the type of data.

Read More
Logo

© 2024 Yajur LLC . All rights reserved