Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 20th, 2011, 06:23 AM
Authorized User
Points: 112, Level: 2
Points: 112, Level: 2 Points: 112, Level: 2 Points: 112, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default xmlnode parsing problem

i am creating a webservice client app
the following is webservice method syntax:
XmlNode serve.GetPolicyDetails(param1,param2);

as you can seen return type is an XmlNode object..
i have to make page where in it will print the output received from the webservice method on my .aspx page in XML format..

how should i do it
please can someone send me a sample code for it
  #2 (permalink)  
Old October 20th, 2011, 07:10 AM
Authorized User
Points: 135, Level: 2
Points: 135, Level: 2 Points: 135, Level: 2 Points: 135, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2007
Location: , , .
Posts: 29
Thanks: 2
Thanked 0 Times in 0 Posts
Default

See if this helps. Not exactly what you asked for but should be enough to get started.
http://www.codeproject.com/Answers/2...t.aspx#answer2

If that is taking too long then here is some code (very trivial though) that might help you.
Since your WS returns a node you can use the OuterXml method of XmlNode object to show the xml in your page.
Here is a sample:
<code>
string xmlString = @"<items><item1 id='1'>Text</item1><item2 id='2'>Text</item2></items>";
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlString);
XmlNode node = doc.SelectSingleNode(@"items/item1");
System.Console.WriteLine(node.OuterXml);
</code>

Last edited by codehelp; October 20th, 2011 at 07:43 AM.. Reason: Sample code
  #3 (permalink)  
Old October 20th, 2011, 11:10 PM
Authorized User
Points: 112, Level: 2
Points: 112, Level: 2 Points: 112, Level: 2 Points: 112, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by codehelp View Post
See if this helps. Not exactly what you asked for but should be enough to get started.
http://www.codeproject.com/Answers/2...t.aspx#answer2

If that is taking too long then here is some code (very trivial though) that might help you.
Since your WS returns a node you can use the OuterXml method of XmlNode object to show the xml in your page.
Here is a sample:
<code>
string xmlString = @"<items><item1 id='1'>Text</item1><item2 id='2'>Text</item2></items>";
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlString);
XmlNode node = doc.SelectSingleNode(@"items/item1");
System.Console.WriteLine(node.OuterXml);
</code>
First of all thanks for your effort.. but i have tried using node.outerxml method but it still returns only a concatinated string containing values of all child nodes together same as an innerxml method..

secondly i want to print the entire xml including the tags and everything that is returned by the webservice on my aspx page ...(XML output format how should i do that)... please its urgent.. please let me know as soon as possible..
  #4 (permalink)  
Old October 21st, 2011, 12:38 AM
Authorized User
Points: 135, Level: 2
Points: 135, Level: 2 Points: 135, Level: 2 Points: 135, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2007
Location: , , .
Posts: 29
Thanks: 2
Thanked 0 Times in 0 Posts
Default Can you please give the code you already have?

Hi,
is it possible for you to post the code you already have?
That may help to understand what is not working properly.

Since the WS method returns a XmlNode, the OuterXml method should be able to do the job, since you say it doesnt please provide a sample code, I will be glad to respond.

Regards.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP/XML Trying to delete a xmlnode Florian_mrt Classic ASP XML 1 March 20th, 2006 02:25 PM
xmldocument & xmlnode albusr .NET Web Services 2 December 20th, 2005 01:46 PM
Service returns xmlNode instead of xmlDocument! KC7ZDM .NET Web Services 0 February 18th, 2005 08:18 PM
Parsing Problem - help! philz XML 5 March 5th, 2004 05:28 AM



All times are GMT -4. The time now is 10:13 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.