Monday, 25 June 2012

How to: view and monitor http traffic from the WFS and WMS FDO providers.

Fiddler is a wonderful tool for debugging http requests and responses. However if you ever tried using Fiddler to monitor http requests made by the WFS and WMS FDO providers in MapGuide or any application using FDO, you will find that Fiddler does nothing.

There's a simple trick you can do to make sure these requests show up in fiddler.

We'll use MapGuide as an example. If the MapGuide Service is running, stop it. This trick requires running the MapGuide Server as an application instead of a service. Fire up a command prompt and navigate to the server\bin directory of your MapGuide installation (eg. C:\Program Files\OSGeo\MapGuide\Server\bin)

From here type the following:

set HTTP_PROXY=localhost:8888

Then run the MapGuide Server in as an application

mgserver.exe run

Now when you interact with any WFS/WMS feature source for this session, the outbound requests will be shown in Fiddler.




Why this works is because localhost:8888 is the port that fiddler's http proxy runs on. Any web requests that go through this proxy will appear under fiddler. Secondly, HTTP_PROXY is a special environment variable that curl uses as a proxy server if it is defined. The WFS and WMS FDO providers also use the curl library to dispatch their http requests, thus this technique works for these providers as well.

Combine the two and the WFS and WMS providers will be dispatching http requests through Fiddler's proxy server, hence they will show up in fiddler if you have set the HTTP_PROXY environment variable first before running the application that uses these FDO providers.

This trick should work with any application using the curl library for doing http requests.

1 comment:

pawel.sadownik@gmail.com said...

Hi,
Have you tried to compare the traffic load of the same phisical artefacts served as WMS and WFS? I know it is artificial and dependant on what is presented. However I cannot find any type of analisys of the traffic genarated by these two protocols.
Regards