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 the message that’s being exchanged over the wire.
We can use many online tools to see the content of the message, here we are using Fiddler in a scenario for a while now. Fiddler is a free HTTP debugging proxy server application/tool, which captures the HTTP(s) traffic and logs the content for us to view. Fiddler is a Web Debugging Proxy, First, download and installs it if don't have.

Scenario

There are many adapters which involve the HTTP protocol and transfer data from one system to another system. In the below scenario, we have to transfer data through BizTalk machine to the destination system and need to know which type of data we are processing.
For example, if we want to check the TLS version over the data transmission, need for identifying which version of TLS we are using in HTTP traffic.

Set up Fiddler

To set up and use Fiddler is easy. Download the tool and install it on our (BizTalk) machine. In order to make fiddler intercept BizTalk messages:
We first need to identify which port fiddler listens to.

For this, go to Tools => Options... => Connections Tab




Default Port value is 8888.
Default Server Name is: 127.0.0.1



We 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.
 

Static Send Port


In BizTalk's static send port which has been configured to use HTTP/SOAP/WCF adapter we 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 Adapter:



In Send Port with SOAP Adapter:



Dynamic Send port


For the dynamic send port, the proxy details are resolved from the context of the outbound message. Hence we have to construct the outbound message context as follows below;

  • WCF adapter


msgOrder(WCF.ProxyAddress) = <a href="http://localhost:8888">http://localhost:8888</a>;
msgOrder(WCF.ProxyToUse)  = "UserSpecified";

  • SOAP/HTTP adapter

For SOAP/HTTP adapter (Change SOAP to HTTP based on adapter used)

msgOutboundRequest(SOAP.UseProxy) = true;
msgOutboundRequest(SOAP.ProxyAddress) = "locahost";
msgOutboundRequest(SOAP.ProxyPort) = "8888";

If we don’t want to execute this code in production, then ensure these codes are executed only in debug mode.

Now with everything configured in BizTalk for fiddlers, we can start the Fiddler to trace the traffic. If BizTalk configured to use Fiddler, but not started the Fiddler then the 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 we have to make sure our Fiddler is started when BizTalk (which is configured to use a proxy) sends the message.

Resources

You can find the following resources on Fiddler for background information, its feature and other areas where it is used:

See Also

Read suggested related topics:

Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.