Dear All,
I am getting this error when I call a WebService

An unhandled exception of type 'System.Exception' occurred in
Additional information: Client found response content type of 'text/html;
charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
<title>WriteStartDocument had the XML declaration written.</title>

I am throwing an exception from my WebMethod where I am creating a XmlNode
Array from a XmlDocument and passing it to the SoapException

[SoapDocumentMethod(ParameterStyle = SoapParameterStyle.Bare)]
public void ExportObject2Exp()
ClassA myExp = new ClassA();
myExp.setValues("Sunil Menon", 27, "M");
XmlSerializer serializer = new XmlSerializer(typeof(ClassA));
// Serialize the purchase order, and close the TextWriter.
Stream xyz = new MemoryStream();
serializer.Serialize(xyz, myExp);
TextReader reader = new StreamReader(xyz);
XmlDocument doc = new XmlDocument();
xyz.Seek(0, SeekOrigin.Begin);
//Create a reader.
XmlNode[] arrNode = new XmlNode[2];
int nCnt = 0;
XmlTextReader xmreader = new XmlTextReader(reader);
while (xmreader.Read())
arrNode[nCnt]= doc.ReadNode(xmreader);
SoapException se = new SoapException("Fault occurred",SoapException.ClientFaultCode,
Context.Request.Url.AbsoluteUri,node,arrNode );

throw se;

Does anyone know why?

Thanks a lot in advance

Many Regards