Size in Bytes transfered...

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
 
S

Simon Hart [MVP]

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.
 
S

Simon Hart [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top