Click to See Complete Forum and Search --> : hexadecimal value 0x00, is an invalid character


Sunil Menon
04-24-2002, 12:46 AM
Dear All,
I had written a mail before this regarding the same problem. From Willam
I got to know the following:
Well, Hex 0x00 is a Null character, and is not displayable nor can it
beused in places of a Null string. If you are trying to retrieve the data
for display (or to manipulate) into a string, you need to capture the fact
and handle accordinally. (I.E. strField = ds("Field"): If ds("Field") is
Nothing Then strField &= "")

Now to the problem:
I have a WebService which calls a Object's function present in another
dll. This function fetches a record for me. If the function fails it throw
an SQLException defined by me. I catch this SQLException in my WebService
and using SoapFormatter I deserialize this object into an XMLNode and pass
this XML node into the details paramter of a SoapException and throw the
SoapException. But when I throw this SoapException it gives me the error
"hexadecimal value 0x00, is an invalid character".
If I create a exception at my WebService and deserialize and send the SoapException
it Works!!.
I have tried really hard to trace the problem. But I have not been able to
as yet. Could someone help me out with this.

Thanks a lot in advance.

Many Regards
Sunil

Rob Teixeira
04-24-2002, 12:36 PM
"Sunil Menon" <sunil@itb-india.com> wrote:
>
>Now to the problem:
> I have a WebService which calls a Object's function present in another
>dll. This function fetches a record for me. If the function fails it throw
>an SQLException defined by me. I catch this SQLException in my WebService
>and using SoapFormatter I deserialize this object into an XMLNode and pass
>this XML node into the details paramter of a SoapException and throw the
>SoapException. But when I throw this SoapException it gives me the error
>"hexadecimal value 0x00, is an invalid character".

Do you mean Serialize? (not deserialize?)

>If I create a exception at my WebService and deserialize and send the SoapException
>it Works!!.

You mean a custom exception instead of the SQLException, right?

>I have tried really hard to trace the problem. But I have not been able
to
>as yet. Could someone help me out with this.

Save the SQLException XML serialized stream to a file and check to see if
it has a null character in any of the XML data. That's going to be your problem.

-Rob

Sunil Menon
04-25-2002, 12:36 AM
>
>Do you mean Serialize? (not deserialize?)
Yes:-) I am sorry I actually wanted to write Serialize.
>
>>If I create a exception at my WebService and deserialize and send the SoapException
>>it Works!!.
>
>You mean a custom exception instead of the SQLException, right?
>
No. If I create a SQLException at my WebService also it works fine.

>Save the SQLException XML serialized stream to a file and check to see if
>it has a null character in any of the XML data. That's going to be your
problem.
I have done that too. But looking at the XML file I could not find out if
it had a NULL character. How do I find out programmatically? and replace
the NULL character with some value?

Thanks a lot in advance.

Many Regards
Sunil

rohanptl
04-23-2007, 12:25 PM
Hi Sunil,
did you get how to replace the NULL character with some value programatically?