13 April 2020

Making SOAP Request using Postman

Sample WSDL using Postman client of chrome for testing SOAP webservices

WSDL:
http://www.holidaywebservice.com//HolidayService_v2/HolidayService2.asmx?wsdl
Authorization: no Auth
Headers: Content-Type = text/xml
Body:  Select "raw" type with XML(text/xml) format

Select POST option and send below payloads to get response.

Payload for GetCountriesAvailable:
==================================

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hs="http://www.holidaywebservice.com/HolidayService_v2/">
 <soapenv:Body>
 <hs:GetCountriesAvailable></hs:GetCountriesAvailable>
 </soapenv:Body>
</soapenv:Envelope>

Payload for getHolidaysAvailable method defined in this WSDL, give the request body as:
=======================================================================================

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hs="http://www.holidaywebservice.com/HolidayService_v2/">
 <soapenv:Body>
 <hs:GetHolidaysAvailable>
 <hs:countryCode>UnitedStates</hs:countryCode>
 </hs:GetHolidaysAvailable>
 </soapenv:Body>
</soapenv:Envelope>


Payload for GetHolidayDate method defined in this WSDL, give the request body as:
=======================================================================================

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hs="http://www.holidaywebservice.com/HolidayService_v2/">
 <soapenv:Body>
 <hs:GetHolidayDate>
 <hs:countryCode>UnitedStates</hs:countryCode>
 <hs:holidayCode>NEW-YEARS-DAY-ACTUAL</hs:holidayCode>
 <hs:year>2017</hs:year>
 </hs:GetHolidayDate>
 </soapenv:Body>
</soapenv:Envelope>

Payload for GetHolidaysForDateRange:
=====================================
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hs="http://www.holidaywebservice.com/HolidayService_v2/">
 <soapenv:Body>
 <hs:GetHolidaysForDateRange>
 <hs:countryCode>UnitedStates</hs:countryCode>
 <hs:startDate>2017-01-01T00:00:00</hs:startDate>
 <hs:endDate>2018-01-01T00:00:00</hs:endDate>
 </hs:GetHolidaysForDateRange>
 </soapenv:Body>
</soapenv:Envelope>
Reference:
http://blog.getpostman.com/wp-content/uploads/2014/08/SOAP-requests-using-Postman.png?x38712

JAX WS Webservice Example

 Follow this link to create JAX-WS Web Service Deployment on Tomcat Server
https://www.journaldev.com/9133/jax-ws-web-service-deployment-on-tomcat-server
There are some additional dependencies to be added in POM.xml file
Final URL to access this SOAP webservice is
http://hyd-talakokm-l:8080/PorscheROWS/personWS?WSDL
STS Project : PorscheROWS.zip
Payload:
getAllPersons
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hs="http://hyd-talakokm-l:8080/PorscheROWS/personWS">
 <soapenv:Body>
 <hs:getAllPersons>
 </hs:getAllPersons>
 </soapenv:Body>
</soapenv:Envelope>

No comments:

Post a Comment