I’ve been using Service Capture a lot in the last year, but recently just found the coolest feature ever: Map to File.
OK, so a lot of people use Service Capture to see their traffic, what’s getting called, parameters, returns, etc., etc.
Some might even know that you can throttle bandwidth with it – simulate dialup, DSL, or whatever.
But I missed this map to file feature for a long time. You’ll see it right there in the right click menu on any item in the output list. Choose it and you’ll be able to specify matching parameters: Equals, Starts with, or Contains. This is useful when say you want to replace a file that has a no-cache random variable attached:
https://someurl?timestamp=1934839483
You don’t want to match the whole thing, because the timestamp is going to change. Just match Starts with:
https://someurl
Then you browse to a local file to map to. So, for example, you want to replace
https://somedomain.com/application.swf
with
c:/coolapplication/application.swf
This has saved me hours and hours over the last month. Say you’ve deployed a customer’s site, and it’s live on the web, and something isn’t quite right. You can test your local build, but that may not tell you what’s going on with the live site, on a live server with a live backend and database, etc. which may differ from what you have locally. You can swap out a swf on the live site with the same swf on your local machine, throw some trace statements, etc. in there, and run the live site and see what’s happening there.
I’m doing a bit of last minute development with this technique right now. The site isn’t deployed yet, but the whole backend and db is done, and is on an external server and developed by someone else. The swfs need live data to function, and I don’t have time to replicate the whole system locally. I started by building a swf, uploading it to the site and testing it. That got old quick. Now I’ve mapped the server swf to my local swf. I’m still testing on the live site, but can bypass the uploading part each time I need to test something.
I tried out Charles a bit too. I think it has a similar feature called rewriting, but it’s way more complex. I couldn’t get it working right off the bat, and didn’t have the time to mess with it.