Showing posts with label fiddler. Show all posts
Showing posts with label fiddler. Show all posts

Wednesday, 14 October 2009

Fiddler again, Again for SOAP

How amazing. I forgot about my own blog and dug into Fiddler and SOAP again. And with Google I could not find my blog item about Fiddler & SOAP. Very strange.

Now I have some simple code, again, to add the SOAP-action header as a column to Fiddler. Here we go:
public static BindUIColumn("SOAP", 120)
function FillSoapAction(oS: Session) {
if ((oS.oRequest != null)
&& (oS.oRequest.headers != null)
&& (oS.oRequest.headers.Exists("SOAPAction"))) {
var action = oS.oRequest.headers.Item["SOAPAction"];
return action.replace(/^.*\//, "").replace(/"/, "");
} else return String.Empty;
}


Hope you'll use it.

Friday, 6 June 2008

Fiddler helps with SOAP

When you want to inspect your SOAP traffic, you can use the http-debugging-proxy Fiddler to inspect your traffic. But right out of the box you cannot see the method called for each session. For this you can add a rule to the Rules.

Within the class declare the options you need:


// Show SOAP requests

public static RulesOption("Show SOAP Request", "SOAP")

var m_ShowSoapRequest: boolean = false;

Add this to the call OnBeforeResponse:


if (m_ShowSoapRequest) {

//oSession.utilDecodeRequest();

var strRequestStart : String = "><";

var iPos = oSession.utilFindInRequest(strRequestStart, false);

if (iPos != -1) {

var oBodyString : String = System.Text.Encoding.UTF8.GetString(oSession.requestBodyBytes);

iPos = iPos + strRequestStart.Length;

var iEndPos = oBodyString.IndexOf(">", iPos);

var soapRequest : String = oBodyString.Substring(iPos, iEndPos - iPos);

if (soapRequest.IndexOf("/") != -1) {
soapRequest = soapRequest.Substring(0, soapRequest.IndexOf("/"));

}

if (soapRequest.IndexOf(" ") != -1) {

soapRequest = soapRequest.Substring(0, soapRequest.IndexOf(" "));

}

oSession["ui-customcolumn"] = soapRequest;

}

}