Tuesday, June 15, 2010
Sunday, June 13, 2010
Thursday, June 3, 2010
How to invoke a web service call with curl ?
If you are on Windows you can download the curl-7.19.5-win32-ssl-sspi.zip from here.
You can download the SimpleStockQuoteService.aar used in the example from here.
SOAP Invocations
curl -d @request.xml -H "Content-Type: application/soap
+xml action=getQuote" http://localhost:8080/axis2/services/SimpleStockQuoteService
The request.xml will look like following.
POX Invocations
curl -d @request.xml -H "Content-Type: application/xml" http://localhost:8080/axis2/services/SimpleStockQuoteService
*Notice that the Content-Type has changed.
Now the request.xml will look like following.
curl -k -d @request.xml -H "Content-Type: application/xml action=getQuote" http://localhost:8080/axis2/services/SimpleStockQuoteService
You can download the SimpleStockQuoteService.aar used in the example from here.
SOAP Invocations
curl -d @request.xml -H "Content-Type: application/soap
+xml action=getQuote" http://localhost:8080/axis2/services/SimpleStockQuoteService
The request.xml will look like following.
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<getQuote xmlns="http://services.samples">
<request>
<symbol xmlns="http://services.samples/xsd">IBM</symbol>
</request>
</getQuote>
</soapenv:Body>
</soapenv:Envelope>
POX Invocations
curl -d @request.xml -H "Content-Type: application/xml" http://localhost:8080/axis2/services/SimpleStockQuoteService
*Notice that the Content-Type has changed.
Now the request.xml will look like following.
If you want to invoke a service with an HTTPS end point without trusting it's certificate authority - you can use the option "-k"
<getQuote xmlns="http://services.samples">
<request>
<symbol xmlns="http://services.samples/xsd">IBM</symbol>
</request>
</getQuote>
curl -k -d @request.xml -H "Content-Type: application/xml action=getQuote" http://localhost:8080/axis2/services/SimpleStockQuoteService
Subscribe to:
Posts (Atom)