Fiddler2 is a proxy that runs locally on your machine and stays in-between a client (i.e. typically your browser) and the remote server. It can this way intercept the communication between the two and display it in various formats.
So, in order to intercept communication with the Core Service, one should configure their Core Service client application to use the Fiddler proxy. The proxy installs itself on your local machine (when Fiddler starts), and on port 8888.
Intercepted communication shows up in Fiddler somewhat like this:
So, how do I specify a proxy in my client application? That depends on the technology used.
java -Dhttp.proxyHost=localhost -Dhttp.proxyPort=8888 ...
The only caveat is that I couldn't get it to work -- namely, the basicHttp authentication fails when communication goes through the Fiddler proxy. The following error message shows up:
The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'.
However, I can see the authentication attempts are intercepted by Fiddler.
UPDATE: If I use wsHttp endpoint, the authentication negotiation is successful and Fiddler intercepts the communication correctly.
So, in order to intercept communication with the Core Service, one should configure their Core Service client application to use the Fiddler proxy. The proxy installs itself on your local machine (when Fiddler starts), and on port 8888.
Intercepted communication shows up in Fiddler somewhat like this:
So, how do I specify a proxy in my client application? That depends on the technology used.
Java Core Service Clients
There are several ways of doing this, but the idea is that we need to set two properties:
- http.proxyHost - the host name or IP of the proxy server (i.e. localhost for Fiddler);
- http.proxyPort - the port the proxy is listening to (i.e. 8888 for Fiddler);
If you have access to the code, you can set them using the System.setProperty method:
// Fiddler proxy
System.setProperty("http.proxyHost", "localhost");
System.setProperty("http.proxyPort", "8888");
If you have access to the JVM, set the system properties in the startup sequence of the JVM (using the -D notation):
.Net Core Service Clients
Fiddler installs itself as default proxy and .Net uses the default system proxy by default :) So there is nothing specific you need to setup for .Net.The only caveat is that I couldn't get it to work -- namely, the basicHttp authentication fails when communication goes through the Fiddler proxy. The following error message shows up:
The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'.
However, I can see the authentication attempts are intercepted by Fiddler.
UPDATE: If I use wsHttp endpoint, the authentication negotiation is successful and Fiddler intercepts the communication correctly.
Comments