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>
silentthread2kSenior Software EngineerAsked:
Who is Participating?
 
a1jCommented:
put your post xml content into data.xml then try this
curl --data-binary @data.xml http://your.website.com/uri
0
 
silentthread2kSenior Software EngineerAuthor 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
 
silentthread2kSenior Software EngineerAuthor 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.