Introduction
To exchange information between Microsoft BizTalk Server and an application by means of the HTTP(S) protocol, in BizTalk we have many adapters like HTTP, SOAP, WCF adapters. When you send a message to the target application using HTTP(S) protocol, it’s always useful to see the content of a message that’s being exchanged over the wire.
You can use many online tools to see the content of a message, here I am using Fiddler in the scenario. Fiddler is a free HTTP debugging proxy server application/tool, which captures the HTTP(s) traffic and logs the content for us to view.
First, download and install fiddler if you don’t have it.
In order to make fiddler intercept BizTalk messages:
You first need to identify which port fiddler listens to.
For this, go to Tools -> Fiddler Options -> Connections Tab
Default Port value is 8888.
Default Server Name is: 127.0.0.1
You can click on "Copy Browser Proxy Configuration URL" and paste in Internet Explorer to see more details.
Next, Configure BizTalk Adapter. With server name and port details, we can configure the BizTalk send ports.
In Static Send Port
In BizTalk’s static send port which has been configured to use HTTP/SOAP/WCF adapter you have to set the proxy setting (Send port, adapter –> Configure –> Proxy). Choose "Use Proxy" and give the proxy details as shown in below screenshots;
In Send Port with WCF-BasicHttp adapter,
In Send Port with HTTP/SOAP Adapter,
In Dynamic Send port
For a dynamic send port, the proxy details are resolved from the context of the outbound message. Hence, you have to construct the outbound message context as follows below;
For WCF adapter
- msgOrder(WCF.ProxyAddress) = <a href="http://localhost:8888">http://localhost:8888</a>;
- msgOrder(WCF.ProxyToUse) = "UserSpecified";
For SOAP/HTT adapter (Change SOAP to HTTP based on adapter used),
- msgOutboundRequest(SOAP.UseProxy) = true;
- msgOutboundRequest(SOAP.ProxyAddress) = "locahost";
- msgOutboundRequest(SOAP.ProxyPort) = "8888";
You don’t want to execute this code in production, so ensure these codes are executed only in debug mode.
Now, with everything configured in BizTalk for fiddlers, you can start the Fiddler to trace the traffic. If you have configured BizTalk to use Fiddler, but if you have not started the Fiddler then your message would suspend with the following error.
"Unable to connect to the remote server —> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8888"
So you have to make sure your Fiddler is started when BizTalk (which is configured to use a proxy) sends the message.
Summary
In this article, we reviewed how to use Fiddler with BizTalk Adapters to view exchanged messages on the BizTalk server. Hope you've found this post handy. Feel free to add your comments or ask any questions below. If there's anything specifically that you want to be covered with respect to BizTalk please let us know.