WebService using HttpWebResponse

M

Mark

Hi,

I have a web service that returns a DataSet to a .net cf client. At the
moment I'm using the proxy class generated by vs .net to access the web
service. However I would like to use the HttpWebRequest/Response classes.
THe main reason for this is so I can get access to a stream and keep the
user informed of the progress of the download. However how can I get the xml
returned back into a DataSet? Although the .net cf has no serialision
support it can handle SOAP. My question is how can I build a DataSet back on
the client?

Mark
 
C

casey chesnut

you should be able to get the Xml into the DataSet as a stream.
because CF does handle DataSet serialization and deserialization.
(NOTE that typed DataSets are not supported in V1,
but you can get around that with alot of work)

so read it in something like ...
the HttpWebResponse would have a stream of the entire SoapEnvelope.
you would use the XmlDocument to select out the DataSet part only.
then wrap that with an XmlReader, and read that in with DataSet.ReadXml()

Thanks,
casey
http://www.brains-N-brawn.com
 
M

Mark Irvine

Casey,

Many thanks for your reply.

I had read the article you suggest below, however does it apply to the .net
cf? It just it appears to require the presence of a client configuration
file, something that I though was not supported - is this the case?

Mark
 
C

casey chesnut

yes, it would require some porting (i have not tried to port it myself).

as you point out, CF cannot hook SoapExtensions using app.config.
but you alternately specify SoapExtensions using SoapExtensionAttributes.
all you would do is create a SoapExtensionAttribute for that SoapExtension,
and then decorate the method of the client proxy with that Attribute.

also, you might read the GetWebRequest section of this article:
http://www.brains-N-brawn.com/spWse
it explains a little known inheritance change for SP2 that might help for
this.

Thanks,
casey
 
M

Mark Irvine

Casey,

Many thanks for the reply. I took a look at the article you suggested
below. Most of my experience with web service's has been with the full
framework and high bandwidth. Therefore I was wondering if you could
recommend a particluar book that gives a good introduction to using
SoapExtension/SoapExtensionAttributes?

Mark
 
C

casey chesnut

SoapExtensions / Attributes are used alot on the full framework too.
any popular .NET Web Service book should have a chapter on them.
the MSDN documentation is good too.

if i were just starting out, the 1st thing i would do is get the
TraceExtension to work,
(it is the sample that comes with MSDN)
that should give you a better understanding, and then you could move on from
there.

there are some minor limitations for the CompactFramework to be aware of.
the one you stumbled across about not being able to use .config files;
so you have to use SoapExtensionAttributes instead.
also, the class SoapServerMessage does not exist for CF.
this just says if the SoapExtension is running hooked to a client or a
service.
since the CF is always a client, then you dont need that class anyways.

Thanks,
casey
http://www.brains-N-brawn.com
 
M

Mark Irvine

Casey,

Many thanks for taking the time to reply - your help is very much
appreciated

Mark
 

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