DEV Community

Cover image for Call a SOAP service from Postman or Fiddler Using Azure Web Apps
TalhaKhalid101
TalhaKhalid101

Posted on

Call a SOAP service from Postman or Fiddler Using Azure Web Apps

While it’s true that JSON or XML has been the rage for a long time in web services, there are still thousands and thousands of SOAP services in most companies I walk across.

Today I had to do some tests with a super simple example with WCF (in fact, the one that comes with the Visual Studio WCF template) and the truth is that I spent a while until I was able to access the service from Postman or Fiddler correctly. The fact is that I have tried with WCF Test client, which comes as part of Visual Studio and it worked without problems.

WCF Test Client — ​​SOAP service

But when I got to Postman, all I got was a 400 — Bad Request error without much explanation.

Postman SOAP Request — 404 Bad Request

And in Fiddler exactly the same!

After wandering around for a while, I uploaded my service to a Web App in Microsoft Azure and tried one of the many pages that act as a SOAP client, reading from your service definition (WSDL), and that’s where I was able to see what was missing from my request to make it work just as well as in WCF Test Client: the SOAPAction header, plus a correct Content-Length in the case of Postman. In such a way that the configuration to be able to make the call would be the following:

These would be the headers needed to make the request:

SOAP request with parameters — headers

and this is the body of the message:

SOAP request with parameters — body

For Fiddler they would be the same values ​​but in their format:

Fiddler — SOAP request

An additional point to review is that Postman does not calculate the Content-Length automatically as Fiddler does and this can also cause problems when making the request. You can use a page like this (or Fiddler that calculates the content length and updates it by itself) to calculate the size of the content and save you a few more minutes.

AWS Q Developer image

Your AI Code Assistant

Ask anything about your entire project, code and get answers and even architecture diagrams. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Start free in your IDE

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay