tags:

views:

84

answers:

3

I am trying to debug some problems with very picking/complex webservices where some of the clients that are theoretically making the same requests are getting different results. A debugging proxy like Charles helps a lot but since the requests are complex (lots of headers, cookies, query strings, form data, etc) and the clients create the headers in different orders (which should be perfectly acceptable), etc. it's an extremely tedious process to do manually.

I'm pondering writing something to do this myself but I was hoping someone else had already solved this problem?

As an aside does anyone know of any Charles-like debugging proxies that are completely opensource? If Charles were open source I would definitely contribute any work I did on this front back to the project. If there is something similar out there, I would much rather do this than write an separate program from scratch (especially since I imagine Charles or any analog already has all of the data structures I might need etc).

Edit: Just to be clear -- text diffing will not work as the order of lines (e.g. headers at least) may be different and/or the order of values within lines (e.g. cookies at least) can be different and in both cases as long as the names and values and metadata are all the same, the different ordering should not cause requests that are otherwise the same to be considered different.

A: 

If there's nothing purpose built for the job, you can use packet capture to get the message content saved to a text file (something that inserts itself in the IP stack like CommView). The you can text diff the results for different messages.

Software Monkey
I already have the results as text from Charles, but text diffing doesn't work because, as I mentioned, different clients send different headers in different order (which should not affect the response and therefore should also not affect the notion of equivalence).
John
Also, in addition to the ordering of the headers changing on a line-by-line basis, some of the data within a single header (e.g. cookies name/values pairs) can be sent in a different order but should still be considered equivalent.
John
A: 

Can the open-source proxy Squid maybe help?

HTH

cheers,

Rob

Rob Wells
+1  A: 

Fiddler has such an option, if you have WinDiff in your path. I don't know though if it will suit your needs, because at first glance it's jus doing text comparisions. But perhaps it normalizes the sessions before that, so I can't say.

Vilx-
Fiddler does not normalize the headers on diff, it gives you what arrived, in the raw form it arrived.
Piskvor