{"id":31,"date":"2007-03-16T06:14:00","date_gmt":"2007-03-16T11:14:00","guid":{"rendered":"http:\/\/www.rajatswarup.com\/blog\/?p=31"},"modified":"2010-02-10T23:52:27","modified_gmt":"2010-02-11T04:52:27","slug":"using-curl-as-a-soap-client","status":"publish","type":"post","link":"https:\/\/www.rajatswarup.com\/blog\/2007\/03\/16\/using-curl-as-a-soap-client\/","title":{"rendered":"Using cURL as a SOAP client"},"content":{"rendered":"<p><a href=\"http:\/\/curl.haxx.se\/\">cURL (groks URL)<\/a> can be used as a SOAP client to send XML SOAP requests to web services.   But the problems that I was facing in sending the data directly with the -d switch of curl is that DOS command shell would greet me with an error message:<br \/><span style=\"font-weight: bold;font-family:courier new;\" ><br \/>&lt; was unexpected at this time.<br \/><\/span><br \/>But there is a great way to send data in the POST requests by using the -d switch with the @ symbol.  For example to send the xml data in the xmlfilewithdata.xml in the POST request to http:\/\/www.somesite.com\/thewebservice you could use the following command:<br \/>curl -d @xmlfilewithdata.xml http:\/\/www.somesite.com\/thewebservice<\/p>\n<p>Off go all the errors and there it is &#8230;. your SOAP client &#8211; cURL!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>cURL (groks URL) can be used as a SOAP client to send XML SOAP requests to web services. But the problems that I was facing in sending the data directly with the -d switch of curl is that DOS command shell would greet me with an error message:&lt; was unexpected at this time.But there is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[230,197,193],"tags":[330,331,332,235],"class_list":["post-31","post","type-post","status-publish","format-standard","hentry","category-howto","category-tools","category-webappsec","tag-curl","tag-soap","tag-web-services","tag-x-509"],"_links":{"self":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/31","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":1,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":140,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/posts\/31\/revisions\/140"}],"wp:attachment":[{"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rajatswarup.com\/blog\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}