开发者

Capturing outgoing HTTP requests from a Windows Phone app

开发者 https://www.devze.com 2023-02-16 13:13 出处:网络
Is it possible to capture outgoing HTTP requests from a Windows Phone application, and respond to them as if the HTTP server sent the response?

Is it possible to capture outgoing HTTP requests from a Windows Phone application, and respond to them as if the HTTP server sent the response?

Alternatively, could one implement a lightweight http server inside a Windows Phone app, which would then proxy requests onwards to a online web server?


Quick context: I'm researching whether the ESRI ArcGIS for Windows Phone could be adapted to work in offline mode. The ESRI Windows Phone API can use a RESTful JSON web service to load map data, but doesn't s开发者_运维知识库upport offline maps. One option I'm considering is implementing the required subset of the API "in-app", so that the map tiles would be loaded from cache stored on the phone.

In effect I would build a component that would work as a proxy between the client and the web service endpoint, and when the app is in offline mode, the requests would be intercepted and served by the proxy instead of passed on to the server.

Any help would be much appreciated.


Programatically, there is currently no way you can keep track of system-wide HTTP requests from inside your app. Even for your application, you are only able too track requests that you initiate on your own. There might be an endpoint present in the closed (non-public) API but there is nothing in the official tools.

Your best bet would be tracking the requests via an external tool (used WireShark for the example).


You can use Fiddler to capture and manipulate web traffic both in the emulator and on device for WP7 applications.


From the various questions and answers I've seen about trying to intercept requests for the Bing map control, I don't believe it's possible to intercept HTTP requests for offline map display.

I've seen several questions about offline maps - including attempts at reading map tiles from Isolated Storage. Sadly, the existing controls simply don't seem to support this.

You might be able to create your own control to draw the map tiles there are quite a few samples around in various languages - although I've not seen a SL one.

Sorry it's not better news!

0

精彩评论

暂无评论...
验证码 换一张
取 消