> Please, could You tell me, how can I load this Xml document which
> WebService
> provides? I tried to load it into XmlDocument object with Load method, but
> beacause it is not xml file I get errors. The help is very much
> appreciated.
What errors are you getting? Here's why I'm asking:
According to your WebMethod declaration, it returns a
System.Xml.XmlDocument. I don't believe this class is serializable. It isn't
marked as serializable It is important to note the difference between an
XmlDocument class and an XML Document. An XmlDocument class is a class for
working with XMLDocuments.
A WebMethod returns an instance of a class, as an XML Document (NOT a
System.Xml.XmlDocument). The class must be serializable. At the client end,
the class is deserialized back into a class. So, as you can see, it isn't
necessary to create an XML Document; the response is one already. It is
necessary to create a serializable class that can be returned and
de-serialized back into a class.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
"Peter" <> wrote in message
news:6C7A5FDF-B7EC-4DE6-B3DF-...
> Hi!
>
> Please, could You advice me to complete the following task:
>
> We have a Web Service that returns XML document with some data about our
> customers.
>
> [WebMethod]
> public XmlDocument getCustInfo()
> {
> //some implementation
> }
>
> I am trying to parse that document and to print customers' names and email
> addresses. If some custorem does not have an email address I print "no
> email
> address found". I have to go throught the xml document and it's nodes
> using
> eg. foreach statement and resolve whether customer has an email address
> with
> if else statements.
>
> Please, could You tell me, how can I load this Xml document which
> WebService
> provides? I tried to load it into XmlDocument object with Load method, but
> beacause it is not xml file I get errors. The help is very much
> appreciated.
>
> Thanks.
>
> Peter
>
>
|