Fiddler: A tool which gives you a super power

By | August 13, 2014

We talk a lot about implementer’s and testers. Let’s do something for developers today!
Sage CRM works on standard client server architecture where several Request-Response exchanges are happening over the network. Sometimes the Requests and Responses work properly however somewhere in between goes wrong and we start facing http errors. This is one of the developer’s nightmares as it’s extremely difficult to hunt down these types of errors.
New GUMU Solution: Sage CRM integration for Sage ERP X3, Real-time, bi-directional, Multi-folder
Some Basics: –
Web applications, such as Sage CRM, use the HTTP/HTTPS protocol which follows a request/response cycle.  For instance, the browser submits a HTTP request to a server via a specific URL using a “verb” such as GET, POST, etc. with optional query string parameters and request body (possibly JSON, XML, or encoded form data).  The server processes the request and then returns a response (e.g. HTML, JSON, XML, an image file, CSS style sheet, JavaScript file, etc.) back to the browser.  The browser then assimilates these web-based resources and renders a web page (usually).
Being able to investigate the interactions between the browser and server is critical for troubleshooting web applications. This is where Fiddler comes into play:
How Fiddler Works:-
The cool thing about Fiddler is that, it configures itself as a proxy server.  A proxy server acts as an intermediary such that a request is first sent to the proxy, then forwarded to the intended recipient from the proxy.  Then, in turn, the response is sent back to the proxy which then forwards the response to the original requester.  By configuring itself as a HTTP (and secure [HTTPS]) proxy, Fiddler has visibility into all HTTP interactions.  This includes page requests and responses to and from a Sage CRM server.
You’ll first need to download and install Fiddler.  Fiddler is free and download links for .NET 2 and .NET 4 are located here:  Installation is simple.
Capturing HTTP traffic:-
 Here by I’ll show you in an example, how to use Fiddler with Sage CRM:
1. Run Fiddler application.
2. Turn off traffic capturing from the menu File > Capture Traffic
3. Open Sage CRM and navigate to the new opportunity page, then input data for all required fields (but don’t save it).
4. In IE Developer Tools, clear the cache (or have Cache > Always refresh from server toggled on).  Clearing the browser cache will force all page resources (JavaScript, CSS, images, etc.) to be reloaded, making the HTTP sessions visible within Fiddler.
5.Back in Fiddler, clear any visible traffic by selecting the dropdown next to the ‘X’ icon on the toolbar and clicking Remove all.
6. Toggle the capturing of traffic back on in Fiddler, save the new opportunity record in CRM, then toggle it off again in Fiddler.
7. Select the first session on the left then the Inspectors tab on the right.
8.Finally select “WebForms” within the Inspectors tab for the HTTP request (top section) and SyntaxView for the HTTP response (bottom section).  Your Fiddler capture should be similar to the screenshot…
You can now analyze all the traffic between server and the browser, here is the breakdown of different areas of above screen:
1. On the left side are all captured HTTP sessions with usual information such as the resource type, HTTP result code, URL, and so on.  Each session is made up of a request and response which is visible on the right side when a HTTP session is selected.
2. The top section of the right side is the HTTP request.  In other words, this is what the browser submitted to the Sage CRM web server.
3. WebForms, as illustrated here, is particularly useful to view key/value pairs (query string and body) submitted to the server.  Confirming all key/value pairs were submitted as expected is an important troubleshooting step when a page is misbehaving.
4. The bottom section of the right side is the HTTP response.  Here, we’re able to view the raw data returned from the request.  In this case, it’s HTML for the opportunity summary page for the newly created opportunity.
Also Read:
1) Advanced E-mail Management Server Options
2) Client Side API to hide and show Column of grid
3) Confirm if your Sage CRM system has actually expired
4) Rebalancing complex territory structures
5) IIS Tip – Handlers and Feature Permissions