XmlSerializer exception message

  • Thread starter Thread starter Graham Allwood
  • Start date Start date
G

Graham Allwood

Hi,

I am trying to pass some rtf text a a string to a webservice. Now, it is
probably wrong to do this but i does hilight a strange problem.

When I call the webmethod from the client (Windows Forms) I get an exception
from the XmlSerializer, in the debugger the exception message is:

"'\0', hexadecimal value 0x00, is an invalid character. Line 4, position 4."

If I try an display this in the client through MessageBox.Show() I only get
the first charact ('). I guess its because of the null terminator in the
string. But how am I suppose to show this message? Does anyone have any
ideas?

Thanks for your help

Graham
 
* "Graham Allwood said:
I am trying to pass some rtf text a a string to a webservice. Now, it is
probably wrong to do this but i does hilight a strange problem.

When I call the webmethod from the client (Windows Forms) I get an exception
from the XmlSerializer, in the debugger the exception message is:

"'\0', hexadecimal value 0x00, is an invalid character. Line 4, position 4."

If I try an display this in the client through MessageBox.Show() I only get
the first charact ('). I guess its because of the null terminator in the
string. But how am I suppose to show this message? Does anyone have any
ideas?

I assume that you are reading the file with the wrong encoding and so
null characters are found. Null characters are interpreted as string
terminators in some controls. Can you post some code?
 
Back
Top