Invoking a SOAP Request from a Shell Command

I use curl to send a SOAP request to a web service and get a response using shell scripts. please find below the command i am using: -

curl -H "Content-Type: text/xml; charset=utf-8" -H "SOAPAction:" -d @sample_request.txt -X POST http://someWebServiceURL 

I get an error that does not have a SOAPAction header. PFB body part response

 <soapenv:Body> <soapenv:Fault> <faultcode>Client.NoSOAPAction</faultcode> <faultstring>WSWS3147E: Error: no SOAPAction header!</faultstring> </soapenv:Fault> </soapenv:Body> 

Any help is appreciated!

+8
source share
2 answers

You need to specify the name of the SOAP action. You have:

 -H "SOAPAction:" 

Enter the name of the action in it. For example.

 -H "SOAPAction: http://my_example/my_action" 

Get the action name from the WSDL, if any. For example, see How do you define a valid SoapAction? .

+9
source

In the WSDL service you can find SoapAction . And you can find the operation you are trying to call and access the WSDL by opening the service URL in a web browser. Using curl to call SoapAction , you must specify Action with "-H" , for example -H SOAPAction: http://tempuri.org/Execute .

0
source

All Articles