hexadecimal value 0x00, is an invalid character


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: hexadecimal value 0x00, is an invalid character

  1. #1
    Sunil Menon Guest

    hexadecimal value 0x00, is an invalid character


    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



  2. #2
    Rob Teixeira Guest

    Re: hexadecimal value 0x00, is an invalid character


    "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

  3. #3
    Sunil Menon Guest

    Re: hexadecimal value 0x00, is an invalid character


    >
    >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



  4. #4
    Join Date
    Apr 2007
    Posts
    1
    Hi Sunil,
    did you get how to replace the NULL character with some value programatically?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center