Passing an XML document to a web service

S

STom

My Pocket PC device will have a wireless connection to the internet and
there are some web services that I need to call to pass an XML document to.

I will, within the Pocket PC app be reading the XML file and putting the
data into a dataset to use within the device with a SQL CE database. When I
am ready to send to the web service I will just write the data to an xml
file and then send it.

Now, I have heard that the CF does not support serialization but if I'm not
mistaken, web services requires data to be serialized.

Does the web service automatically do the serialization which therefore
relieves the mobile device from having to worry about the serialization
issue?

Also, is it best to pass the XML document as a string or as an XML document.
The web service will not be written in .Net.

Thanks!

STom
 
A

Alex Feinman [MVP]

Web services (SOAP) will do serialization for you. There are no
user-callable serialization methods (No LOS formatter, no binary
serialization etc) but SOAP formatter exists inside System.Web.Services.DLL
although you cannot call it directly.

You have two options to pass xml document between the client and the server.
One is using parameter (or return value) of type XML document. When you
declare web method with return type of XmlDocument, .NET will return the
SOAP response identical to XmlDocument contents - no extra headers at all. I
don't know how much is it compatible with generic SOAP, but you could give
it a try. Write a web method on your platform that returns pure xml
docuemnt, and on the CF side declare it as returning XmlDocument. This way
you get the least overhead. If that fails, use string.
 
S

STom

I believe in my case what I will have to do is convert the xml document to a
string.

The web service will be on an IBM box, either websphere or something like
that, no Microsoft libraries or anything like that.

Thanks.

STom
 

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