473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Returning plain HTML from a web service

I have a web service that I need to return HTML code, and I can't seem
to get rid of the XML tags that surround it. Right now I'm just
writing the HTML into a return string, and am getting something like
this:

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://HTMLSERVICE.com"><html><h3>Loaded..</h3></html></string>

Ideally, I'd like to strip out the XML tags and be able to return just

<html><h3>Loaded..</h3></html>

to the browser. I've tried digging into the HTTP application handlers
(EndRequest etc), but I can't seem to find the correct location/event
to intercept the response before my service returns. Is there a way
to get this type of return from a web service method?
Nov 21 '05 #1
2 4561
Return data from an XML web service is always enclosed in XML. If you would
like to get an HTML page from the web server, try using ASP.NET web
application instead of XML web service.
Aleksey Nudelman
http://csharpcomputing.com

"Chris Bardon" wrote:
I have a web service that I need to return HTML code, and I can't seem
to get rid of the XML tags that surround it. Right now I'm just
writing the HTML into a return string, and am getting something like
this:

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://HTMLSERVICE.com"><html><h3>Loaded..</h3></html></string>

Ideally, I'd like to strip out the XML tags and be able to return just

<html><h3>Loaded..</h3></html>

to the browser. I've tried digging into the HTTP application handlers
(EndRequest etc), but I can't seem to find the correct location/event
to intercept the response before my service returns. Is there a way
to get this type of return from a web service method?

Nov 21 '05 #2
csharpcomputing.com wrote:
Return data from an XML web service is always enclosed in XML. If you
would like to get an HTML page from the web server, try using ASP.NET web
application instead of XML web service.
You could build a browser component that consumes the service and displays
the resulting string as HTML....
Aleksey Nudelman
http://csharpcomputing.com

"Chris Bardon" wrote:
I have a web service that I need to return HTML code, and I can't seem
to get rid of the XML tags that surround it. Right now I'm just
writing the HTML into a return string, and am getting something like
this:

<?xml version="1.0" encoding="utf-8" ?>
<string
xmlns="http://HTMLSERVICE.com"><html><h3>Loaded..</h3></html></string>

Ideally, I'd like to strip out the XML tags and be able to return just

<html><h3>Loaded..</h3></html>

to the browser. I've tried digging into the HTTP application handlers
(EndRequest etc), but I can't seem to find the correct location/event
to intercept the response before my service returns. Is there a way
to get this type of return from a web service method?


--
http://www.texeme.com
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Smith | last post by:
I'm writing a service which accepts a POST call, updates a database and returns raw HTTP headers as specified below: HTTP/1.1 200 OK Content-type:text/plain Content-length:3 OK The code...
8
by: Randall Parker | last post by:
I want to generate an HTML tag that will look like: <a href="EquipmentServiceCreate.aspx?serial=X01">Create New Service For X01</a> or on a different instance where the user would be viewing...
2
by: Tarren | last post by:
Hi: What would be some standard convention to follow when writing web services for return types for .NET only data types? I initially wrote my web service that returns some XML as...
5
by: LS | last post by:
Can a WebMethod return an Interface type? Can we pass an interface parameter ? Example : public interface IEntity { long Id { get; set; } string Name { get; set; } }
5
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was...
4
by: David Lozzi | last post by:
Howdy, I'm using a WYSIWYG editor called TinyMCE. When I edit some text and then save it back to my SQL server using a SQLCommand, all HTML characters are changed to HTML code, i.e. &gt;strong&lt;...
1
by: arfeengodil | last post by:
Hi, I need to have a web application such that other applications should be able to do send data to it using HTTP Post. So I created a ASP.NET web service and defined a web method for other...
15
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 ...
0
by: robert112 | last post by:
Hi All, I have a .net WSE 3.0 Web Service acting as a client calling a j2EE web Service. The service works when I call it using a client program called soapUI (which is free to download) but when...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.