Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / January 2006

Tip: Looking for answers? Try searching our database.

Xml element serialize problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
denis_rusakov@epam.com - 05 Jan 2006 11:41 GMT
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>&#x2;</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.
Javier G. Lozano - 05 Jan 2006 13:49 GMT
Could you list the characters you're trying to send back to the client?
The more we know, the easier it is to help you out.
denis_rusakov@epam.com - 05 Jan 2006 13:54 GMT
For example I'm trying this character '?' , but I think never mind what
character exactly...

> Could you list the characters you're trying to send back to the client?
> The more we know, the easier it is to help you out.
denis_rusakov@epam.com - 05 Jan 2006 13:58 GMT
I mean not '?' ,  but character - smiling face... )))

> For example I'm trying this character '?' , but I think never mind what
> character exactly...
>
>> Could you list the characters you're trying to send back to the client?
>> The more we know, the easier it is to help you out.
Javier G. Lozano - 05 Jan 2006 17:07 GMT
I'm sorry, I'm having a hard time understanding you.  Do you have
another character that's easier to work with?
Javier G. Lozano - 05 Jan 2006 17:14 GMT
Are your characters listed in this link:
http://www.w3.org/TR/REC-html40/sgml/entities.html ?
denis_rusakov@epam.com - 09 Jan 2006 07:30 GMT
I'm trying to send any special character in XmlElement, for example, &#x2
via Web-Service.
AFAIK each special character has been encoded in XML

ms-help://MS.MSDNQTR.2004APR.1033/cpguide/html/cpconSpecialCharacterConversionWhenWritingXMLContent.htm

in server side it's ok (special characters are encoded), but when client
retrieve XmlElement, I think, client try to decode special characters from
&#x2 and replace them to one symbol , of course XML can't contains
characters such as - smiling face character - and I've got exception.
What I can do in this situation??

See below...

> Are your characters listed in this link:
> http://www.w3.org/TR/REC-html40/sgml/entities.html ?

I didn't find it.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.