You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Met&Iv <ro...@hotmail.com> on 2010/04/14 17:19:27 UTC

[XML-RPC Error] Cannot parse string responses

Hi, it's the first time we write on this forum, we hope we are posting this
question in the right section :p

we are trying to use XML-RPC to allow process communication in localhost, it
seems to work well but when we get back a String return we got the following
exception:

[Fatal Error] :1:83: An invalid XML character (Unicode: 0x11) was found in
the element content of the document.
Exception in thread "main" org.apache.xmlrpc.client.XmlRpcClientException:
Failed to parse server's response: An invalid XML character (Unicode: 0x11)
was found in the element content of the document.
        at
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:188)
        at
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
        at
org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
        at
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
        at
org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
        at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
        at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
        at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
        at host_coordinator.RPCClient.execute(RPCClient.java:42)
        at
host_coordinator.Host_Coordinator.startVirtualEnvironment(Host_Coordinator.java:46)
        at host_coordinator.Main.main(Main.java:21)
Caused by: org.xml.sax.SAXParseException: An invalid XML character (Unicode:
0x11) was found in the element content of the document.
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1234)
        at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
        at
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:186)
        ... 10 more
Caused by:
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x11) was
found in the element content of the document.
        at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1234)
        at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
        at
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:186)
        at
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
        at
org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
        at
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
        at
org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
        at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
        at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
        at
org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
        at host_coordinator.RPCClient.execute(RPCClient.java:42)
        at
host_coordinator.Host_Coordinator.startVirtualEnvironment(Host_Coordinator.java:46)
        at host_coordinator.Main.main(Main.java:21)

We also tried to get back integers and so on... and it seems to works with
them.
we used both version 3.1.2 / 3.1.3 of xmlrpc lib, and still nothing
changed...

please help us!
-- 
View this message in context: http://old.nabble.com/-XML-RPC-Error--Cannot-parse-string-responses-tp28244078p28244078.html
Sent from the Apache Xml-RPC - Dev mailing list archive at Nabble.com.


Re: [XML-RPC Error] Cannot parse string responses

Posted by Jochen Wiedmann <jo...@gmail.com>.
Be careful! Make sure you specify an encoding when converting the
string to binary!


On Thu, Apr 15, 2010 at 12:16 PM, Met&Iv <ro...@hotmail.com> wrote:
>
> Fixed, thank you very much for the help :)
>
> We used org.apache.commons.codec.binary.Base64 class to convert our String
> and so it worked!
>
> tugwilson wrote:
>>
>>
>> On 14 Apr 2010, at 18:09, Met&Iv wrote:
>>
>>>
>>> We are just trasfering simple strings... the method is something like
>>> "Hello
>>> World" nothing more...
>>>
>>
>> Well, your "simple string" has got a vertical tab in it.
>>
>> The other possibility is that you have got the encoding wrong, but that's
>> really unlikely to cause problems with  simple data (the parser will auto
>> detect UTF-8 and UTF-16 and US ASCII is a subset of UTF-8)
>>
>> John Wilson
>>
>
> --
> View this message in context: http://old.nabble.com/-XML-RPC-Error--Cannot-parse-string-responses-tp28244078p28253514.html
> Sent from the Apache Xml-RPC - Dev mailing list archive at Nabble.com.
>
>



-- 
Germanys national anthem is the most boring in the world - how telling!

Re: [XML-RPC Error] Cannot parse string responses

Posted by Met&Iv <ro...@hotmail.com>.
Fixed, thank you very much for the help :)

We used org.apache.commons.codec.binary.Base64 class to convert our String
and so it worked!

tugwilson wrote:
> 
> 
> On 14 Apr 2010, at 18:09, Met&Iv wrote:
> 
>> 
>> We are just trasfering simple strings... the method is something like
>> "Hello
>> World" nothing more...
>> 
> 
> Well, your "simple string" has got a vertical tab in it.
> 
> The other possibility is that you have got the encoding wrong, but that's
> really unlikely to cause problems with  simple data (the parser will auto
> detect UTF-8 and UTF-16 and US ASCII is a subset of UTF-8)
> 
> John Wilson
> 

-- 
View this message in context: http://old.nabble.com/-XML-RPC-Error--Cannot-parse-string-responses-tp28244078p28253514.html
Sent from the Apache Xml-RPC - Dev mailing list archive at Nabble.com.


Re: [XML-RPC Error] Cannot parse string responses

Posted by John Wilson <tu...@wilson.co.uk>.
On 14 Apr 2010, at 18:09, Met&Iv wrote:

> 
> We are just trasfering simple strings... the method is something like "Hello
> World" nothing more...
> 

Well, your "simple string" has got a vertical tab in it.

The other possibility is that you have got the encoding wrong, but that's really unlikely to cause problems with  simple data (the parser will auto detect UTF-8 and UTF-16 and US ASCII is a subset of UTF-8)

John Wilson

Re: [XML-RPC Error] Cannot parse string responses

Posted by Met&Iv <ro...@hotmail.com>.
We are just trasfering simple strings... the method is something like "Hello
World" nothing more...



Jochen Wiedmann wrote:
> 
> The server is indeed producing invalid XML. The character 0x11 is no
> valid text character in XML, consequently the XML parser barks.
> 
> What are you transferrring? Binary data? If so, you should do it using
> base64.
> 
> Jochen
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/-XML-RPC-Error--Cannot-parse-string-responses-tp28244078p28245496.html
Sent from the Apache Xml-RPC - Dev mailing list archive at Nabble.com.


Re: [XML-RPC Error] Cannot parse string responses

Posted by Jochen Wiedmann <jo...@gmail.com>.
The server is indeed producing invalid XML. The character 0x11 is no
valid text character in XML, consequently the XML parser barks.

What are you transferrring? Binary data? If so, you should do it using base64.

Jochen



On Wed, Apr 14, 2010 at 5:19 PM, Met&Iv <ro...@hotmail.com> wrote:
>
> Hi, it's the first time we write on this forum, we hope we are posting this
> question in the right section :p
>
> we are trying to use XML-RPC to allow process communication in localhost, it
> seems to work well but when we get back a String return we got the following
> exception:
>
> [Fatal Error] :1:83: An invalid XML character (Unicode: 0x11) was found in
> the element content of the document.
> Exception in thread "main" org.apache.xmlrpc.client.XmlRpcClientException:
> Failed to parse server's response: An invalid XML character (Unicode: 0x11)
> was found in the element content of the document.
>        at
> org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:188)
>        at
> org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
>        at
> org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
>        at
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
>        at
> org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
>        at
> org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
>        at
> org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
>        at
> org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
>        at host_coordinator.RPCClient.execute(RPCClient.java:42)
>        at
> host_coordinator.Host_Coordinator.startVirtualEnvironment(Host_Coordinator.java:46)
>        at host_coordinator.Main.main(Main.java:21)
> Caused by: org.xml.sax.SAXParseException: An invalid XML character (Unicode:
> 0x11) was found in the element content of the document.
>        at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1234)
>        at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
>        at
> org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:186)
>        ... 10 more
> Caused by:
> org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x11) was
> found in the element content of the document.
>        at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1234)
>        at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
>        at
> org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:186)
>        at
> org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
>        at
> org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
>        at
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
>        at
> org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
>        at
> org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
>        at
> org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
>        at
> org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
>        at host_coordinator.RPCClient.execute(RPCClient.java:42)
>        at
> host_coordinator.Host_Coordinator.startVirtualEnvironment(Host_Coordinator.java:46)
>        at host_coordinator.Main.main(Main.java:21)
>
> We also tried to get back integers and so on... and it seems to works with
> them.
> we used both version 3.1.2 / 3.1.3 of xmlrpc lib, and still nothing
> changed...
>
> please help us!
> --
> View this message in context: http://old.nabble.com/-XML-RPC-Error--Cannot-parse-string-responses-tp28244078p28244078.html
> Sent from the Apache Xml-RPC - Dev mailing list archive at Nabble.com.
>
>



-- 
Germanys national anthem is the most boring in the world - how telling!