Sunday, September 28, 2008

Using cURL for SOAP

How to issue a SOAP request (to Sonoa's ServiceNet) using cURL from the command line:

shell command:
curl \
-H "SOAPAction: urn:getCustomerDetails" \
-H "Content-Type: text/xml" \
-d "@getCustomerDetails.xml" \
http://192.168.96.132:8080/samples/services/CustomerInfoService
where getCustomerDetails.xml is a file in the current directory.

getCustomerDetails.xml:
xmlns:soapenv=
"http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cus=
"http://www.sonoasystems.com/schemas-samples/2007/1/26/customer">
12
shell output:
xmlns:soapenv=
"http://schemas.xmlsoap.org/soap/envelope/">
xmlns=
"http://www.sonoasystems.com/schemas-samples/2007/1/26/customer">
12
City 12
USA
Name 12
CA
Street 12
Zip 12

No comments:

Post a Comment