Service Capture – Map to File

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:

http://someurl?timestamp=1934839483

You don’t want to match the whole thing, because the timestamp is going to change. Just match Starts with:

http://someurl

Then you browse to a local file to map to. So, for example, you want to replace

http://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.

This entry was posted in Flash, General. Bookmark the permalink.

5 Responses to Service Capture – Map to File

  1. Peter says:

    OMG, that’s so cool — just bought a license of Service Capture yesterday and didn’t realize the potential of that feature. That’ll definitely save me hours worth of debugging, thanks for sharing that tip Keith!

  2. John says:

    Slick! I just picked up ServiceCapture and that will be very useful for a project I’m working on.

  3. Yes that IS a killer feature 🙂 I discovered it just last week where i was working on a project where the deployment involved different servers and getting data from various resources both locally as from the internet, not to mention that to get something deployed needed a formal request to the IT department and could take several hours. This feature alone saved me so much time and it work’s really well with the Flex Debugger too 🙂

  4. kb says:

    Nice feature, except it doesn’t work when proxying to SSL-encrypted sites. I bet it’s an ‘upcoming’ feature.

  5. Jim says:

    ServiceCapture 2.0 now supports maping to directories, even cooler.

Leave a Reply