[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 697
  • Last Modified:

How can I call a webservice using curl?

How can I call a webservice using curl?
http://linux.about.com/od/commands/l/blcmdl1_curl.htm

I can't seem to find any sample code.
I'm trying to do something simple like call myserver.aspx with some data...

<xml><myservice>test</myservice></xml>

and then get someting back like...

<xml><myservice>test-success</myservice></xml>
0
silentthread2k
Asked:
silentthread2k
  • 2
  • 2
1 Solution
 
a1jCommented:
put your post xml content into data.xml then try this
curl --data-binary @data.xml http://your.website.com/uri
0
 
silentthread2kAuthor Commented:
Thanks, to get it to work, I had to specify the content length and type. I should have mentioned that it's a linux box trying to call a windows box webservice...

curl --header "Content-Type: application/soap+xml;charset=UTF-8;action="http://tempuri.org/TestMethod"
 Content-Length: 198" --data @envelope.xml "http://mywebservice.asmx"
0
 
silentthread2kAuthor Commented:
curl --header "Content-Type: application/soap+xml;charset=UTF-8;action="http://tempuri.org/TestMethod"
 Content-Length: 198" --data @envelope.xml "http://mywebservice.asmx"
0
 
a1jCommented:
I'm glad you got it to work.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now