Posted on 2006-05-19
Last Modified: 2008-02-01
Hi All, I have implemented my webservice using java and using
Axis 1.3. The client is developed using .Net 2005 (

basically the client sends to the server a string.

my problem is that sometimes. i get this error when i'm sending the string......

org.xml.sax.SAXParseException: Character reference "&#x0" is an invalid XML character.

 i don't know which character cannot reconize.....
Question by:marianatagliaferro
    LVL 14

    Expert Comment

    I think your problem is that the string you pass to the web service sometimes contains invalid characters.
    You probably need to encode the string to guarantee that no invalid characters will be sent. Base64 encoding is one good choice.


      Nayer Naguib

    Author Comment

    do you have an example to this encode in and decoded in java
    LVL 14

    Accepted Solution

    Here's the VB .NET part:

            Dim s As String
            s = Convert.ToBase64String(New System.Text.ASCIIEncoding().GetBytes("Hello, Base64 World!!"))

    Now the string s holds the value "SGVsbG8sIEJhc2U2NCBXb3JsZCEh", which is the Base64 encoded version of the string "Hello, Base64 World!!".
    The Java part should look like this:

          try {
                String encoded = "SGVsbG8sIEJhc2U2NCBXb3JsZCEh";
                byte[] buffer = new sun.misc.BASE64Decoder().decodeBuffer(encoded);
                String s=new String(buffer);
          catch (Exception e) {

    Now the string s holds the value "Hello, Base64 World!!".


      Nayer Naguib

    Author Comment

    Thank you very much!!!!! it worked perfectly.... :)

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now