Even after following what is mentioned here: https://learning.postman.com/docs/sending-requests/supported-api-frameworks/making-soap-requests/ i.e., set Content-Type = text/xml in the Headers and setting POST as a call, at times we get 500 internal server error or bad request with the message like " error message: The message with Action '' cannot be processed at the receiver..."
So, what are we missing here?
Setting SOAPAction in Headers is worth giving a try... How do we get that?
1. Open your WSDL in a browser with the service URL appended by “?WSDL" and find soapAction for which you want to execute your SOAP call. Like for the "Add" method in http://www.dneonline.com/calculator.asmx?WSDL, soapAction should be set to http://tempuri.org/Add
2. Copy the value of soapAction attribute of your SOAP method. Add a new key, provide Key as “SOAPAction” and the value that you copied in the above step i.e., http://tempuri.org/Add
3. Set “Content-Type” header as “text/xml” and Provide SOAP Envelop in Body like in this case:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Add xmlns="http://tempuri.org/">
<intA>10</intA>
<intB>10</intB>
</Add>
</soap:Body>
</soap:Envelope>
4. Hit Send
With this setting, you should receive a proper SOAP response from the service.
Comments
Post a Comment