I have an XML file that is located on the hard drive of the server my web service is running on. I need to access this file from another application.
This is my method on my web service.
Public Function getXMLFile() Dim xmlDocument As System.Xml.XmlDocument xmlDocument = New System.Xml.XmlDocument() xmlDocument.Load("C:\Sommaire.xml") Return xmlDocument End Function
When I go to my web service and try to call my method, I get the following error:
Fix System.InvalidOperationException: An error occurred that generated the XML document. ---> System.InvalidOperationException: type System.Xml.XmlDocument cannot be used in this context.
This is caused when I try to return an xmlDocument object
From the information I gathered, it looks like SOAP, which wants to combine my XML into more XML and does not allow me to do this.
How do I retrieve an XML file from my web service if I cannot return the XML?
source share