I am new to creating .NET Services. I have created a service that does a database query and produces an XML file in OPML format. The service is being called call from a DHTML web page using XMLHttp. Everything is working great except for the service is html encoding my "<" and ">" characters to "<" and ">". For my XML output I need these characters to remain what they are. How do I tell the service not to perform the html encoding? I was wondering if this was in the Globalization setting in web.config? responseEncodin g is currently set to utf-8.
I am using Visual Studio 2003 with .Net 1.1.
OPML example
I need my XML output to look like the above example. All my "<" and ">" symbols are getting html encoded.
Web service:
.NET is also adding this before and after the OPML:
I need the <?xml version="1.0" encoding="utf-8" ?> bit but I dont need the <string> tags. Is this a key to my problem?
Any help appreciated. Thanks
I am using Visual Studio 2003 with .Net 1.1.
OPML example
Code:
<opml version="1.0">
<head>
</head>
<body>
<outline text="fruit">
<outline text="orange"/>
<outline text="apple">
<outline text="red delicious"/>
<outline text="braeburn"/>
</outline>
</outline>
</body>
</opml>
Web service:
Code:
[WebMethod]
public string EntityTable()
{
try
{
StringBuilder xmlString = new StringBuilder();
//Add a bunch of XML text to string here
return xmlString.ToString();
}
catch (Exception ex)
{
return ex.ToString();
}
}
Code:
<?xml version="1.0" encoding="utf-8" ?> <string xmlns="http://localhost/webservices/"> </string>
Any help appreciated. Thanks