Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Send xml from Web Service response

Posted on 2009-04-14
2
Medium Priority
?
219 Views
Last Modified: 2012-05-06
Hello,

I developed a web service method whos response is in the code section below.  How can I send a xmlDocument back from the web service?  When I try to access the method locally it says the return type is an XmlNode instead of XmlDocument which the method returns.

Thanks!
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetBoatByIDResponse xmlns="http://.com/">
      <GetBoatByIDResult>xml</GetBoatByIDResult>
    </GetBoatByIDResponse>
  </soap:Body>
</soap:Envelope>

Open in new window

0
Comment
Question by:grogo21
2 Comments
 
LVL 9

Accepted Solution

by:
Gorkem Yuksel earned 1000 total points
ID: 24143824
Can you post the code for the function you are calling?

Basically, in the function, if you set the return type to be XmlDocument, that is the type of object it will return.  

ie:
[WebMethod]
public XmlDocument SomeMethod()
{
     XmlDocument xmlDoc = new XmlDocument();
     return xmlDoc;
}
0
 
LVL 14

Assisted Solution

by:GiftsonDJohn
GiftsonDJohn earned 1000 total points
ID: 24144537
Hi,

You can have reference to the following url

HOW TO: Use XmlDocument Elements When Passed to or Returned from WebMethods by Using Visual C# .NET
http://support.microsoft.com/kb/330600
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Loops Section Overview
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question