Illegal XML characters / axis

I developed a web service and deployed it using Axis. Everything works very well, but I have a problem when I use this service using a string containing a non-printable character (for example, ETX, FS, ..). I have the following error:

exception: java.lang.IllegalArgumentException: The char '0x1c' after '....' is not a valid XML character.

Do you have any ideas?

edit:

I need to send a frame to my server using a web service. My frame has a strict form (containing some non-printable character as a separator)

class Automate {void checkFrame(String frame){// checking the frame}}

wsdl file

<?xml version="1.0" encoding="UTF-8"?>

                                 

  <wsdl:part element="impl:checkFrameResponse" name="parameters"/>

  <wsdl:part element="impl:checkFrame" name="parameters"/>

  <wsdl:operation name="checkFrame">

     <wsdl:input message="impl:checkFrameRequest" name="checkFrameRequest"/>

     <wsdl:output message="impl:checkFrameResponse" name="checkFrameResponse"/>

  </wsdl:operation>

  <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

  <wsdl:operation name="checkFrame">

     <wsdlsoap:operation soapAction=""/>

     <wsdl:input name="checkFrameRequest">

        <wsdlsoap:body use="literal"/>

     </wsdl:input>

     <wsdl:output name="checkFrameResponse">

        <wsdlsoap:body use="literal"/>

     </wsdl:output>

  </wsdl:operation>

  <wsdl:port binding="impl:AutomateSoapBinding" name="Automate">

     <wsdlsoap:address location="http://localhost:8080/Gateway/services/Automate"/>

  </wsdl:port>

+5
source share
4 answers

This is a natural problem with SOAP, unfortunately - it uses XML for text, and these characters cannot be represented in XML (even with entities).

- , ? , .

+3

, XML-, XML- SOAP, , - , . :

<your_elt your_attr="Don&apos;t put unescaped chars here, eg, apostrophe">
    <foo>
        Be sure to escape stuff here too, like: 2 &lt; 100
        A greek lambda is escaped like this: &#955;
    </foo>
</your_elt>

, Java, , . , Apache StringEscapeUtils.

XML . , StringEscapeUtils .

, .

+1

CDATA , xml ( ), , , .

+1

, , XML. , , , , "" . Base64, , , MTOM - -.

( -), /, base64 .

0

All Articles