G
Guest
Hello,
I've got some problem with pass Xml element that contains special characters
( through ) via Web-service.
For example -
Server:
[WebMethod]
public XmlElement HelloWorld()
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("<a></a>");
return doc.DocumentElement;
}
Client:
Service1 s = new Service1();
s.HelloWorld();
and I've got such exception
System.InvalidOperationException: There is an error in XML document (1,
295). --
-> System.Xml.XmlException: '', hexadecimal value 0x02, is an invalid
character
.. Line 1, position 300.
at System.Xml.XmlScanner.ScanHexEntity()
at System.Xml.XmlTextReader.ParseBeginTagExpandCharEntities()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.ReadCurrentNode(XmlDocument doc, XmlReader
reader)
at System.Xml.XmlDocument.ReadNode(XmlReader reader)
at System.Xml.Serialization.XmlSerializationReader.ReadXmlNode(Boolean
wrappe
d)
How can I fix this problem??
Thank you.
I've got some problem with pass Xml element that contains special characters
( through ) via Web-service.
For example -
Server:
[WebMethod]
public XmlElement HelloWorld()
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("<a></a>");
return doc.DocumentElement;
}
Client:
Service1 s = new Service1();
s.HelloWorld();
and I've got such exception
System.InvalidOperationException: There is an error in XML document (1,
295). --
-> System.Xml.XmlException: '', hexadecimal value 0x02, is an invalid
character
.. Line 1, position 300.
at System.Xml.XmlScanner.ScanHexEntity()
at System.Xml.XmlTextReader.ParseBeginTagExpandCharEntities()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.ReadCurrentNode(XmlDocument doc, XmlReader
reader)
at System.Xml.XmlDocument.ReadNode(XmlReader reader)
at System.Xml.Serialization.XmlSerializationReader.ReadXmlNode(Boolean
wrappe
d)
How can I fix this problem??
Thank you.