Re: Autoresponder and SOAP requests

1,326 views
Skip to first unread message

EricLaw

unread,
Jun 15, 2012, 8:53:34 PM6/15/12
to httpf...@googlegroups.com
You're looking for the new URLAndBody match text feature added to recent versions of Fiddler (this is well covered in the new Fiddler2 book).
 
For the URL Match box, you'd put something like:
 
    URLWithBody:Activate.asmx regex:^.*=Connect.*$
 
Depending, of course, on the actual content of the request body.

On Friday, June 15, 2012 7:00:15 AM UTC-7, Oleg wrote:
How I can catch requests to SOAP service and maintain autoresponds to it? 
I.e. all requests have the same uri: http://myhost.com/mysvc.asmx
and method calls are in body of requests. 
As I understand I can manage uri rules but not content of message.
Example of query

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.544)
Content-Type: text/xml; charset=utf-8
Content-Length: 7388
Expect: 100-continue

<?xml version="1.0" encoding="utf-8"?><soap:

Fadi Scavo

unread,
Jul 15, 2013, 7:17:04 AM7/15/13
to httpf...@googlegroups.com
I need to do the same thing but with SOAPAction. I tried setting a rule like Header:SOAPAction ".." but it didn't work. Am I missing something?
 
Thanks

EricLaw

unread,
Jul 15, 2013, 12:18:09 PM7/15/13
to httpf...@googlegroups.com
Fadi-- It would be helpful if you said what you tried exactly
 
(Unless you're saying that your rule was literally Header:SOAPAction ".." in which case I'd like to understand what you'd hope this would do?)

Fadi Scavo

unread,
Jul 15, 2013, 2:14:18 PM7/15/13
to httpf...@googlegroups.com
Hi Eric,
All I need to do is to intercept my WCF calls and respond with local SOAP messages (saved on my local machine).
 
The URI is
 
The SOAPAction is
 
The rule is
 
Fadi
 
 
 

 

EricLaw

unread,
Jul 15, 2013, 7:13:02 PM7/15/13
to httpf...@googlegroups.com
Sorry, you need it to look like this:
 
    Header:SOAPAction="http://localhost/PWS_User/getUser"

Fadi Scavo

unread,
Jul 16, 2013, 4:53:07 AM7/16/13
to httpf...@googlegroups.com
Thank you for responding to my questions so quickly. You have been very helpful.
 
Two more things, is it normal to have an exception when I click the button "Test"? and what if I want to add another rule to the header rule (to check the parameters which I pass in the SOAP methods)?

EricLaw

unread,
Jul 16, 2013, 11:59:20 AM7/16/13
to httpf...@googlegroups.com
1. The exception is a bug, thanks for reporting it. (You cannot use the TEST function for a rule not based on URL). I've fixed this for the next build.
 
2. Today, Rules can evaluate multiple criteria only for the Method and URLWithBody criteria. (E.g. METHOD: POST SomeTextIntheURL)
 
Allowing the specification of multiple criteria more broadly is an interesting idea, but for now if you need to do something this complicated, your best bet is to update your OnBeforeRequest script method to identify requests of interest, and set a flag on those Sessions (e.g. oSession.oFlag["replyNumber1"]="match!";), then use a Flag:replyNumber1 rule in the AutoResponder to target that request.

Sridhar Chodavarapu

unread,
Oct 14, 2013, 6:38:17 PM10/14/13
to httpf...@googlegroups.com
Does this work in Fiddler v4.4.5.5? 

My request:

Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Cookie: JSESSIONID=420q9vzfq44uengbi3tke1dc
Content-Length: 421
Expect: 100-continue
Connection: Close

My AutoResponder Rule:

Header:Cookie="JSESSIONID=420q9vzfq44uengbi3tke1dc"
Action: *drop

But the request goes to completion and never gets dropped.

EricLaw

unread,
Oct 14, 2013, 7:31:01 PM10/14/13
to httpf...@googlegroups.com
Your rule includes quotation marks that aren't present in the header value. Please update it to:

  Header:Cookie=JSESSIONID=420q9vzfq44uengbi3tke1dc
  Action: *drop

Micael Soares

unread,
Apr 3, 2016, 11:05:28 AM4/3/16
to Fiddler
Hi,

Does Fiddler 4.6.2.2 Already evaluate multiple criteria? 
Like Header value and REGEX? 
or header and EXACT?

For example:
Header: X-Core-APPId=1.0.0 Regex: http://localhost/store.*

Thanks

EricLaw

unread,
Apr 4, 2016, 9:05:41 PM4/4/16
to Fiddler
Unfortunately, not consistently. Some of the criteria do (e.g. METHOD:POST partialUrl) but most do not. In some cases, you can use multiple rules, some which use an *exit action, to develop advanced criteria. 

Alternatively, you can write code inside FiddlerScript's OnBeforeRequest header to set a Session Flag on Sessions of interest (using extremely complex criteria) then use a Flag rule to match those requests in the AutoResponder. (Or just set X-ReplyWithFile in the FiddlerScript, if the desired response is already in a file).
Reply all
Reply to author
Forward
0 new messages