Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 19th, 2007, 09:00 AM
Authorized User
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Return an XML string from aspx page

HI All,
I have created a web service which I do not want to expose on internet so I have created an interface suppose Interface.aspx
which calls the webmethod and user has access to this page and sends the input XML string as querystring.
Now by passing the input XML string I call the web service and then web service returns the XML to Interface.aspx and in this page I have a textarea.
But when I call it from client application I shoul get the XML only(returned by web service) where as I am getting following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">^M
<html xmlns="http://www.w3.org/1999/xhtml" >^M
        Untitled Page^M
    <form name="form1" method="post" action="Interface.aspx" id="form1">^M
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMjgzMDgzOTgzZGS0Z6oZ670UiJb9JiWWT1fYreD0tQ= =" />^M
        <textarea name="txtOutputString" rows="10" cols="20" id="txtOutputString">&lt;?xml version=&quot;1.0&quot;?&gt;&lt;error&gt;&lt;id&gt ;&lt;/id&gt;&lt;message&gt;An Unexpected error has occured. &lt;/message&gt;&lt;/error&gt;</textarea>^M

Please help me to return XML only not HTML stuff.
Thanks in advance...

No WAY is good until you know your DESTINATION
No WAY is good until you know your DESTINATION
Old November 20th, 2007, 12:42 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Can you please post the relevant code to this problem? (Please don't post everything.)

Old November 23rd, 2007, 05:56 AM
Authorized User
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Peter,
Thanks for interest in solving my problem. I got a solution for my problem.
Now I am sending output XML string in HttpWebResponse object's header.
Now this header will be read by client application and he get the XML string only not the HTML code I uploaded in my problem.
Thanks a lot...

No WAY is good until you know your DESTINATION

Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning XML from aspx page to windows app monuindia2002 .NET Web Services 1 February 10th, 2006 07:18 PM
how to return string value with quotes (single or tllcll BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 3 November 10th, 2005 01:57 PM
MySQL return a String instead of an INT peg110 PHP Databases 2 December 2nd, 2004 01:23 PM
Add XSLT transformed XML (html) on an aspx page humour XSLT 2 September 30th, 2004 05:13 AM
Return String is Different kochoo Classic ASP Components 2 October 19th, 2003 05:41 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.