SOAP Requests Using Postman Error – Solved!

Postman logo+text 320x132

You have an existing working SOAP project in SOAPUI that you want to run in Postman but you cannot make it work due to a 500 Http error or some other error? Follow the steps below to make it work 🙂

First..

From SOAPUI copy your SOAP message and then paste it to Postman. I’m using a sample ASMX service for global weather below.

Soapmessage

From this blog post from Postman, their advised is to add the wsdl and operation tags in the message. But this does not work for me.

And then..

From Postman make sure the Content-type is text/xml.

Postmanxmlmsg

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET">
   <soapenv:Header/>
   <soapenv:Body>
      <web:GetCitiesByCountry>
         <!--Optional:-->
         <web:CountryName>Philippines</web:CountryName>
      </web:GetCitiesByCountry>
   </soapenv:Body>
</soapenv:Envelope>

Here’s the trick

Some SOAP web services will work with just the message in an envelope format. But if not, try adding a SOAPAction in the header of your request just like in the sample below.

Postmanheader

Here is the full request headers and body.

Postmanconsol

curl -X POST -H "Content-Type: text/xml" -H "SOAPAction: http://www.webserviceX.NET/GetCitiesByCountry" -H "Cache-Control: no-cache" -H "Postman-Token: 3e9ad6f4-e669-18ef-6da1-c603371ca1c6" -d '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET">
   <soapenv:Header/>
   <soapenv:Body>
      <web:GetCitiesByCountry>
         <!--Optional:-->
         <web:CountryName>Philippines</web:CountryName>
      </web:GetCitiesByCountry>
   </soapenv:Body>
</soapenv:Envelope>' "http://www.webservicex.com/globalweather.asmx"

This will do the trick in making SOAP requests using Postman. Enjoy!

Notepad++ – Source Code Editor and More

 

Using Notepad++ with Visual Studio

To compliment Visual Studio, I use Notepad++ as my other source code editor. Visual Studio is still my primary IDE but its good to have Notepad++ on the side for that quick search in files, syntax highlighting depending on the language or even when you want to compare texts or codes. There are other free code editors out there like Notepad2 or Sublime but my vote goes to Notepad++.

My Favorite Notepad++ Features

Syntax Highlighting

Notepad++ Syntax Highlighting

You get to choose from the programming languages like C#, C++, SQL, XML to Objective-C or Perl for syntax highlighting.

Find In Files

When I’m working on a big solution file in Visual Studio and I want to look for all references of a specific method, property or keyword I use Notepad++ Find In Files. Instead of waiting for Visual Studio to return to me a list of instances, I just search it with Notepad++. It will take time and it will make Notepad++ unresponsive during search but I can still continue with my coding in Visual Studio.

Notepad++ FindInFiles

 

Plugins

There are number of plugins that are available for install and download. The plugins manager is also a plugin by itself. Just like Package Manager in Visual Studio its the source where third party features can be found.

Notepad++ PluginsManager

 

Useful Plugins

TextFx

Notepad++ TextFxUnwrapText

If you find yourself working on a big chunk of text and its supposed to stay on one line, you can use the “Unwrap Text” option of TextFx. It will remove the newline and carriage return characters of the text to make it a one line.

StraightText

XML Tools

If you are working with XML messages that is sent as a one line of string you can use the “Pretty Print with Line Breaks” option of XML tools. This will arrange the XML nodes with proper indention to make it easier for you to inspect the XML string you have.

Notepad++ XMLToolsPrettyPrint

XMLFormattedText

 

I hope this little note for Notepad++ helps.