473,467 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Webservice returns XmlDocument with wrong encoding

Hi.

Im writing a web service that returns an XML Document that it retrieves from
a file in disk or a stream. But the web service always returns the XML
document with this header:

<?xml version="1.0" encoding="utf-8" ?>

This happens even when the file in disk already has a header specifying a
different encoding. Here's a part of the web service code:

[WebMethod]
public XmlDocument GetXML( )
{
XmlDocument xmld = new XmlDocument();
xmld.Load(path); // path is a string with the url to the XML file in disk
return doc;
}

The rest of the XML is delivered without change. I've specified the XML's
encoding like this:

XmlDeclaration decl = (XmlDeclaration) xmld.FirstChild;
decl.Encoding = "ISO-8859-1";

I always get the same utf-8 encoding header at the output. Any ideas on
what's wrong?
Sep 26 '06 #1
0 1125

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

Similar topics

7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
0
by: Sathya | last post by:
Hi, I have a vb.net webservice which takes XMLDocument as a parameter and returns bool. Signature of the method is some thing like this AddXmlEmpDetails(xmlEmp as XMLDocument) as Boolean. I...
1
by: jens Jensen | last post by:
Hello , i'm calling a webservice generated with oracle webservice java tools. I'm not able to add a web reference to a .net client the usual way with visual studio 2005. I was therefore...
0
by: TimHortonAddict | last post by:
Hi, I'm trying to change from a Vb6 COM component to a C#.Net webservice as we move from Windows server 2000 to Windows server 2003. I've recreated the functionality of the the COM component...
3
by: Pebble | last post by:
Hi folks, I have a WebService that simply acts as a thin wrapper to a .Net dll. Literally almost zero code in the WebService. Parameters passed to the WebService are simply used as...
2
jlrodrigues
by: jlrodrigues | last post by:
I have this WebService with a webmethod tha returns XML, accessed by HTTP POST... The webservice response is: <?xml version="1.0" encoding="utf-8"?> XML For XML i create a XMLDocument...
4
by: =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?= | last post by:
Hi everybody, I've got two questions about using the EnableSession property with an ASP.NET WebService: First Question: I'm trying to create a web service with EnableSession=true. I can't...
0
by: programmerboy | last post by:
Hi, Can we return XMLDocument from webservice? If yes then why I am getting following exception "Cannot implicitly convert type 'System.Xml.XmlNode' to 'System.Xml.XmlDocument'" If I test my...
1
by: gihan | last post by:
Hi, I have a problem accessing remote webservice from my asp code. Instead of returning results, it returns list of web methods it has. Wonder where i'm doing wrong. Also note that, this is a...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.