Solved

Send xml from Web Service response

Posted on 2009-04-14
2
210 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 250 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 250 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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 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