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
- Create a new inbound port
- Give the port a name
- Select the HTTP adapter
- Select the web site to host it. Their setup is located at /System Administration/Setup/Services and Application Integration Framework/Web sites
- Select the service operations you want to test
- Set up logging (optional) by setting the logging mode to “Original document”
Set Up Web Debugging Proxy
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!
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).
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
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.
- Open /System Administration/Setup/Services and Application Integration Framework/Inbound ports
- Select the HTTP inbound port created earlier
- Deactivate the service if it is currently deployed and active
- Click on the “Configure” button next to the adapter setting
- In the configuration editor window that appears, navigate to Advanced/Service Behaviors/routingServiceBehavior/serviceDebug
- Change IncludeExceptionDetailsInFaults to True
Send your request again, and it will point you to the place in your request that has the typo!
I am not sure where you are getting your info, but great topic. I needs to spend some time learning more or understanding more. Thanks for wonderful info I was looking for this info for my mission.
hi
thanks for a great info i am able to follow it. I have created a service to read sales order for test how can i use Postman to send the request to read sales order by passing the sales id paramater
Thank you
You’ll need to adjust the SOAP body section to instruct AX on what you want.
Keep up the good work! Thanks.
I know this if off topic but I’m looking into starting my own blog and was curious what all is required to get
setup? I’m assuming having a blog like yours would cost
a pretty penny? I’m not very web smart so I’m not 100% sure.
Any suggestions or advice would be greatly appreciated.
Cheers
Hi Brayden,
Blogs are cheap, like $5/mo. You might start by looking at WordPress or Wix. If you want to focus on content and not a web site, just use Medium.com.
Take care.
Dag III
Woah! I’m really loving the template/theme of this blog.
It’s simple, yet effective. A lot of times it’s hard to get
that “perfect balance” between user friendliness and visual appeal.
I must say you’ve done a fantastic job with this. Additionally,
the blog loads very fast for me on Opera. Outstanding
Blog!
You can certainly see your expertise within the
work you write. The sector hopes for even more passionate writers like you who aren’t afraid to say how they believe.
All the time follow your heart.
Spot on with this write-up, I really believe this
site needs far more attention. I’ll probably
be returning to see more, thanks for the information!
Hello there, I discovered your blog by means
of Google while searching for a similar matter, your web site came
up, it seems good. I have bookmarked it in my google bookmarks.
Hi there, just was aware of your weblog thru Google, and located that it’s really informative.
I am gonna be careful for brussels. I’ll be grateful in the event you proceed
this in future. Many other people will likely be benefited out of your writing.
Cheers!
Thank you for sharing your info. I truly appreciate your efforts and I will be
waiting for your further post thanks once again.
It’s a shame you don’t have a donate button! I’d certainly donate to this outstanding blog!
I suppose forr now i’ll settle for book-marking and addding yopur RSS feed to my Google account.
I lokk forward to brand new updates and will share his website with my Facebook group.
Chat soon!