views:

551

answers:

3

Hi,

I'm developing a .NET CF client application and using web services for data transfer. I'm using SharpZipLib to compress transfered datasets so I know the size of the transfered byte array.

I wonder is there an easy way to determine to complete request size (html headerder, soap envelops and the real data) for a single call. I really want to minimize the GPRS connection costs.

Thanks...

+1  A: 

Re the overall question; sorry, I don't know short of using a network tracer...

However; can I humbly propose that datasets and SOAP are not always the best choice on bandwidth restricted devices? Compression does a good job, but not always ideal. Unless you need the features offered, simpler protocols are available (such as POX, perhaps using inbuilt protocol compression (GZIP/Deflate)).

At the other end of things... if you can phrase things as messages, then serializers like protobuf-net might be useful (combined with raw binary posts); they are very data dense (such that attempts to use compression inevitably increases the size). However, you'd need to do your own data/change tracking at the client, and the RPC stack is as-yet incomplete (I've got working prototype code, but I haven't committed it yet, as I'm still unit testing it). The server would also be different (i.e. not an asmx or whatever - perhaps a rigged handler or MVC controller).

As another alternative - ADO.NET Data Services might be of interest, especially in JSON mode (for bandwidth, again using protocol compression).

Marc Gravell
You are right, may be web services is not a good choice but I don't think I have time to change all the structure. I also use db4o on client devices which supports server-client type communication but I'm not sure it support compression.
xarux
A: 

Wireshark is a famous protocol analyzer tool. However it may be an overkill for your needs.

Also checkout Fiddler. This is easier and it will allow you to monitor traffic from an emulator.

tcpmon is a Java utility that can sit between a server and a client. You need to edit the endpoint in your application to connect to tcpmon and configure tcpmon to proxy all requests to the actual web service. It shouldn't take more than 10 minutes - it is a very simple utility. Then you can monitor the raw requests in tcpmon or capture traffic with Fiddler.

kgiannakakis
I have used Fiddler before but never tried Wireshark. From WM Emulator which connects to internet through Activesync Fiddler doesn't capture the traffic. But thanks for reminding these two.
xarux
A: 

WCF supports message tracing which would let you see the size of the generated SOAP+Message. You could use these trace files to determine what you are looking for although with compression on your communications the bytes sent will be less obviously. For the actual on the wire size wireshark would be a good bet. Or you could zip the message pulled from the WCF trace and get a rough idea.

Ira Miller