Below is step by step to test request and response on webservice.
Create a request01.xml in server.
Example command : cat > request01.xml
and then paste your xml.
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:NSS="http://tempuri.org/MyService">
<soapenv:Header/>
<soapenv:Body>
<NSS:retrieveDataReq>
<AgencyCode>123456</AgencyCode>
<BranchCode>MyBranch011</BranchCode>
<RequestDateTime>2016-01-18T14:35:00</RequestDateTime>
</NSS:retrieveDataReq>
</soapenv:Body>
</soapenv:Envelope>
Use below curl command to send the request.
curl --header "Content-Type: application/soap+xml;charset=UTF-8" --data @request01.xml http://192.168.1.20:82/webserviceName?wsdl
The response will show in terminal with the raw XML. this curl is use for test the request and response on webservice.
Create a request01.xml in server.
Example command : cat > request01.xml
and then paste your xml.
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:NSS="http://tempuri.org/MyService">
<soapenv:Header/>
<soapenv:Body>
<NSS:retrieveDataReq>
<AgencyCode>123456</AgencyCode>
<BranchCode>MyBranch011</BranchCode>
<RequestDateTime>2016-01-18T14:35:00</RequestDateTime>
</NSS:retrieveDataReq>
</soapenv:Body>
</soapenv:Envelope>
Ctrl + c to exit the cat command.
Use below curl command to send the request.
curl --header "Content-Type: application/soap+xml;charset=UTF-8" --data @request01.xml http://192.168.1.20:82/webserviceName?wsdl
The response will show in terminal with the raw XML. this curl is use for test the request and response on webservice.
No comments:
Post a Comment