Test Your Web Service - POX
What is Web Service:
"Web Service" is described as a standardized way of communicating and integrating different systems. This communication primarily happens over HTTP.
When testing a Web Service, there are multiple tools and options available. With this "Test your Web Service" post, I am going to publish about few approaches to test a Web Service. In the first post, I use POX based approach to test it.
Testing Your Web Service using POX:
POX(Plain Old XML) means exchanging plain old XML documents over HTTP, and this is a subset of REST. Here you can parse values to the Web Service as URL query parameters.
In this post, I am going to use the Global Weather service available online in below URL. It can be named as the web service URL.
Web service URL : http://www.webservicex.com/globalweather.asmx
You can see the contract(WSDL) of the test web service by navigating to the below URL: http://www.webservicex.com/globalweather.asmx?wsdl
So there you can see this Web Service supports two operations and they are "GetWeather" and "GetCitiesByCountry". Here I am going to invoke the "GetCitiesByCountry" operation in POX way.
You can compose the web service URL to invoke an operation by appending the operation name to the end of the service URL.
http://www.webservicex.com/globalweather.asmx/GetCitiesByCountry
Then to pass the query parameters to the operation you can use the "?" and name/value pairs of the parameters (?CountryName=Australia). For multiple parameters "&" should be used in between parameters.
For that open your browser and enter the following URL: http://www.webservicex.com/globalweather.asmx/GetCitiesByCountry?CountryName=Australia
This will display all the cities supported by this weather check web service.
"Web Service" is described as a standardized way of communicating and integrating different systems. This communication primarily happens over HTTP.
When testing a Web Service, there are multiple tools and options available. With this "Test your Web Service" post, I am going to publish about few approaches to test a Web Service. In the first post, I use POX based approach to test it.
Testing Your Web Service using POX:
POX(Plain Old XML) means exchanging plain old XML documents over HTTP, and this is a subset of REST. Here you can parse values to the Web Service as URL query parameters.
In this post, I am going to use the Global Weather service available online in below URL. It can be named as the web service URL.
Web service URL : http://www.webservicex.com/globalweather.asmx
You can see the contract(WSDL) of the test web service by navigating to the below URL: http://www.webservicex.com/globalweather.asmx?wsdl
So there you can see this Web Service supports two operations and they are "GetWeather" and "GetCitiesByCountry". Here I am going to invoke the "GetCitiesByCountry" operation in POX way.
You can compose the web service URL to invoke an operation by appending the operation name to the end of the service URL.
http://www.webservicex.com/globalweather.asmx/GetCitiesByCountry
Then to pass the query parameters to the operation you can use the "?" and name/value pairs of the parameters (?CountryName=Australia). For multiple parameters "&" should be used in between parameters.
For that open your browser and enter the following URL: http://www.webservicex.com/globalweather.asmx/GetCitiesByCountry?CountryName=Australia
This will display all the cities supported by this weather check web service.
Comments