A few things to consider:
- the media type (
Content-Typeheader field) for SOAP requests should be
application/soap+xml(see SOAP 1.2 specs, end of section 1.3). If your encoding is UTF-8, then set
Content-Type: application/soap+xml; charset=UTF-8.
SOAPActionheader field is left undefined, meaning
curlis not sending that field at all. You can check this if you run
- to send your XML (binary) payload as-is, you can use
--data-binaryoption, instead of
-d/--data. It will preserve newlines and carriage returns. For XML content that shouldn’t make any difference, but that probably depends on strictness of parser and schema used.
- when debugging
curlrequests, it’s useful to bounce the request off of echo sites like httpbin, as well as enable full verbosity with
-vvv, maybe even use
--trace*to inspect the exact payload sent/received.
Applying those fixes, your
curl command will look like:
curl -H 'Content-Type: application/soap+xml; charset=UTF-8' \ -H 'SOAPAction: Some-Action' \ --data-binary @request.xml \ <endpoint>