views:

3946

answers:

5

Do you guys know how I can use the Curl command line to POST SOAP to test a web service?

I have a file (soap.xml) which has all the soap message attached to it I just don't seem to be able to properly post it.

Thanks!

+3  A: 

Posting a string:

curl -d "String to post" "http://www.example.com/target"

Posting the contents of a file:

curl -d @soap.xml "http://www.example.com/target"
Luca
Usually this header is also necessary: -H "Content-Type: application/soap+xml;charset=UTF-8"
tokland
+1  A: 

@Luca

Please note that the data should be URL-encoded.

Hank Gay
A: 

If you are doing soap with php I recommend checking out nusoap

http://sourceforge.net/projects/nusoap/

Erratic
+1  A: 

He's not doing SOAP with PHP. He just wanted a command to send a HTTP POST with a SOAP-Request in it. So don't just propose things not needed here.

A: 

If you want a fluffier interface than the terminal, http://hurl.it/ is awesome.

oliland