Search code examples
.netwcfwindows-phone-7wcf-client

how to calculate the size of data transfered from Windows phone 7 to a REST WCF service over the internet?


I need to calculate the size of the data transfered using mobile internet connection. and I am confused how to do it, can somebody please guide me to calculate the size based on my scenarios.

My application is doing these functions.

  • Reading geo location in standard formats and passing it to a wcf service.
  • When our delivery man is pressing a button (could be any action) then again we are passing it to a wcf service

So in simple words we are using internet and consuming WCF services. We are aiming to pass a string of maximum 500 characters, based on the message type. like if its a geo location then the string could be < 30 characters if some action has been done like a button has been pressed it could be from 30 to 500 characters.

Because we are using internet available on the sim and only 500 mb is allowed per month and we dont want to exceed this limit.

So i need to calculate the size of the data transfered at one time to that webservice. Size interms of kilobytes etc

Thanks


Solution

  • There are a lot of things that could affect the data size. You have the data, but you have metadata like the XML envelope, packet headers, etc. There's also the question of whether the requests are compressed. The way to actually know how large it is would be to make the calls over your regular network and use something like Wireshark or Fiddler (depending on where you're actually testing) to look at the data packets. Then you'd know exactly how big they are. With a little testingyou could probably derive a resonable algorithm to estimate packet size based on your data.