Size in Bytes transfered...

  • Thread starter Thread starter Armando Rocha
  • Start date Start date
A

Armando Rocha

Hi,

I call an webservice from my mobile application to send an array trought
them. It is possible get de size in bytes of data that webservice transfer
to server?. My goal is show in a label de value of data transfer like this:
" your transfer x Kb ".


--
Armando Rocha
Mobile Developer

http://www.ifthensoftware.com
PORTUGAL
 
You can write a soap extension that runs on your web server with your web
service which then you can get the length of the whole message (inc. the SOAP
envelope header etc) assuming you are using SOAP.
 
You need to look at SoapExtension class (supported on the CF for client side
support):
http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapextension.aspx

The method you'll be intererested in is ProcessMessage which you override in
your class. This method gets called four times for each method invocation and
you inspect the SoapMessage object to determine whether the message is
inbound or outbound. You'll probebly be interested in
SoapMessageStage.AfterSerialize which is the actual data sent over the wire
and occurs client end.

You will need to modify the WSDL proxy and add the extension for the
interested web methods - assuming you are wanting to do this client side.

There are probably hundreds of samples on the web blogs etc, try searching
using google.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com
 
Back
Top