Postman is a great tool for debugging web sites and web services. For developing web services the free edition works well and is a great proof of concept that can be given to the development team doing the integration on the other side. In this post we’ll walk through how to use Postman to test Dynamics AX 2012 web services.

Set up AX AIF Inbound Port

Postman does not support net.tcp protocol as of yet. So we need to create a new inbound port using the HTTP adapter. It will reference the same service operations, so you can debug the service by sending a request from Postman. Open /System Administration/Setup/Services and Application Integration Framework/Inbound ports

Creation of new HTTP inbound AIF port in AX 2012
  1. Create a new inbound port
  2. Give the port a name
  3. Select the HTTP adapter
  4. Select the web site to host it. Their setup is located at /System Administration/Setup/Services and Application Integration Framework/Web sites
  5. Select the service operations you want to test
  6. Set up logging (optional) by setting the logging mode to “Original document”

Set Up Web Debugging Proxy

Automatically Authenticate rule

First we install Fiddler, a web debugging proxy. The tool will let us eavesdrop on the communication between Postman and Dynamics AX. The current NTLM (Windows auth) functionality in Postman is still in BETA and I had a hard time getting it working, so as a ‘always works’ approach, start Fiddler and turn on the “Automatically Authenticate” rule. You must leave Fiddler running this mode while you use Postman. This will assist Postman so that it can authenticate with AX AIF. Now Postman will not need to negotiate NTLM authentication, nor need to send any authentication headers. Without this step we’d receive a “401 Unauthorized” / “IIS 8.5 Detailed Error – 401.2 – Unauthorized” response.

Use Postman to Retrieve the WSDL XML

Now install and open Postman. The registration is optional. Create a new basic request.

Put in the URL of the WSDL file of the web service you want to test. In my example I am using: http://servername/MicrosoftDynamicsAXAif60/dag/xppservice.svc?WSDL

Click the bright blue Send button!

Successful call to WSDL file

Using Postman to Call a Service Operation

In order to hit a service operation, you need to understand how to look at the WSDL file for the operation information (Postman documentation).

How to find the SOAP action to include in the HTTP headers from the WSDL XML

This is what worked for Dynamics AX 2012-

  • Change HTTP method from GET to POST
  • Leave the get Params empty (the ?WSDL is not needed)
  • Authorization should be “No Auth” because Fiddler is doing it for us
  • Headers-
    • Content-Type: text/xml
    • SOAPAction: http://tempuri.org/AXServiceName/ServiceOperationName – this comes from the WSDL file
  • Body – This needs to be a valid SOAP request, with an envelope
Headers used in SOAP request
SOAP request with proper envelope and namespaces, but with no data being passed into AX
Successful Postman Call to Dynamics AX 2012

Extra Credit: Configure WCF Web Service to Send Error Information in the Response

As you are sending requests to the web service, with even a minor typo you’ll likely receive an HTTP 500 response from the web service, citing “Internal Service Error…The server was unable to process the request due to an internal error.” Then it explains how to change the WCF web service configuration in order to get a better error message. Well, with Dynamics AX this is a bit different, or actually easier.

  1. Open /System Administration/Setup/Services and Application Integration Framework/Inbound ports
  2. Select the HTTP inbound port created earlier
  3. Deactivate the service if it is currently deployed and active
  4. Click on the “Configure” button next to the adapter setting
  5. In the configuration editor window that appears, navigate to Advanced/Service Behaviors/routingServiceBehavior/serviceDebug
  6. Change IncludeExceptionDetailsInFaults to True

Send your request again, and it will point you to the place in your request that has the typo!