Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

How to return a typed XmlDocument in a webservice?

Mar 6 2003 5:23 AM
In the following code I tried to return a typed XmlDocument in my webservice, as described by the MSDN Article you'll find below: [return: System.Xml.XmlElement(typeof(Items[]))] public System.Xml.XmlDocument WBICTypedXmlDataDocument(){ ... } The class Items contains nothing but variable declarations, also as described in the article. The problem is: compiler generates the following error on that first line ([return: ...]) c:\inetpub\wwwroot\thijs2\SymPageRequest\SymPageRequest.asmx.cs(420): The type or namespace name 'XmlElement' does not exist in the class or namespace 'System.Xml' (are you missing an assembly reference?) The reference to System.Xml is set as it should (I can use it without any problem in other parts of the code). Has anybody got an idea what's the problem here? MSDN Article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service02112003.asp