Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Xml element serialize problem

Reply
Thread Tools

Xml element serialize problem

 
 
Guest
Posts: n/a
 
      01-05-2006
Hello,
I've got some problem with pass Xml element that contains special characters
(� through &#x1f 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.ParseBeginTagExpandCharEn tities()
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.Re adXmlNode(Boolean
wrappe
d)

How can I fix this problem??
Thank you.


 
Reply With Quote
 
 
 
 
Javier G. Lozano
Guest
Posts: n/a
 
      01-05-2006
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.

 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      01-05-2006
For example I'm trying this character '?' , but I think never mind what
character exactly...


"Javier G. Lozano" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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.
>



 
Reply With Quote
 
Guest
Posts: n/a
 
      01-05-2006
I mean not '?' , but character - smiling face... )))

<(E-Mail Removed)> wrote in message
news:OqhvC%(E-Mail Removed)...
> For example I'm trying this character '?' , but I think never mind what
> character exactly...
>
>
> "Javier G. Lozano" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.com...
>> 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.
>>

>
>



 
Reply With Quote
 
Javier G. Lozano
Guest
Posts: n/a
 
      01-05-2006
I'm sorry, I'm having a hard time understanding you. Do you have
another character that's easier to work with?

 
Reply With Quote
 
Javier G. Lozano
Guest
Posts: n/a
 
      01-05-2006
Are your characters listed in this link:
http://www.w3.org/TR/REC-html40/sgml/entities.html ?

 
Reply With Quote
 
Guest
Posts: n/a
 
      01-09-2006
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/cpconSpecialCharacterConversionWhenWritingXMLConte nt.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...

"Javier G. Lozano" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Are your characters listed in this link:
> http://www.w3.org/TR/REC-html40/sgml/entities.html ?
>

I didn't find it.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serialize XML without ?xml tag Neil Java 4 09-28-2009 04:22 PM
how to Update/insert an xml element's text----> (<element>text</element>) HANM XML 2 01-29-2008 03:31 PM
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Serialize complex type element with simple content Albert Jan ASP .Net Web Services 2 10-05-2004 07:41 AM
serialize to SQL Server Blob instead of XML serialize Gordz ASP .Net 3 06-07-2004 07:46 PM



Advertisments