luisicozgz | 6 Sep 2007 10:15
Picon
Favicon

Problem with Java anda xml-rpc

Hello,

I want to communicate Java and PHP with XML-RPC but I have the next 
exception:

Failed to parse servers response: Expected methodResponse element, 
got br
	at 
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse
(XmlRpcStreamTransport.java:177)
	at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest
(XmlRpcStreamTransport.java:145)
	at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest
(XmlRpcHttpTransport.java:94)
	at 
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest
(XmlRpcSunHttpTransport.java:44)
	at org.apache.xmlrpc.client.XmlRpcClientWorker.execute
(XmlRpcClientWorker.java:53)
	at org.apache.xmlrpc.client.XmlRpcClient.execute
(XmlRpcClient.java:166)
	at org.apache.xmlrpc.client.XmlRpcClient.execute
(XmlRpcClient.java:157)
	at org.apache.xmlrpc.client.XmlRpcClient.execute
(XmlRpcClient.java:146)
	at comunicacion.<init>(comunicacion.java:83)
	at Main.main(Main.java:9)

Somebody can help me?

(Continue reading)

Paul Libbrecht | 6 Sep 2007 10:47

Re: Problem with Java anda xml-rpc

Luis,

try to set XmlRpc.setDebug(true) or something such... (maybe new  
versions have a commons-logging setting, that'd be in the FAQ).  
You'll see the dump of all xml content and response exchanges and  
will be able to understand the issue.

paul

Le 6 sept. 07 à 10:15, luisicozgz a écrit :

> Hello,
>
> I want to communicate Java and PHP with XML-RPC but I have the next
> exception:
>
> Failed to parse servers response: Expected methodResponse element,
> got br
> 	at
> org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse
> (XmlRpcStreamTransport.java:177)
> 	at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest
> (XmlRpcStreamTransport.java:145)
> 	at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest
> (XmlRpcHttpTransport.java:94)
> 	at
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest
> (XmlRpcSunHttpTransport.java:44)
> 	at org.apache.xmlrpc.client.XmlRpcClientWorker.execute
> (XmlRpcClientWorker.java:53)
(Continue reading)

Gaetano Giunta | 6 Sep 2007 11:00
Picon
Gravatar

Re: Problem with Java anda xml-rpc

looks like you are not getting back an xml response (since you are 
geting a BR element, it looks more like html)

this usually means either:
- you are not calling the correct php page, check your url
- http auth and any proxy/firewall in between
- the php page is generating an error, thus not sending back valid xml

1 please try to call the webservice url via a smple browser GET and see 
what you get
2 try calling the webservice using the public xmlrpc debugger at 
http://gggeek.raprap.it/debugger/
3 set up an http sniffer between client and server. wireshark is a good 
general purpose one

> Hello,
>
> I want to communicate Java and PHP with XML-RPC but I have the next
> exception:
>
> Failed to parse servers response: Expected methodResponse element,
> got br
> at
> org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse
> (XmlRpcStreamTransport.java:177)
> at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest
> (XmlRpcStreamTransport.java:145)
> at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest
> (XmlRpcHttpTransport.java:94)
> at
(Continue reading)

John Wilson | 6 Sep 2007 10:42
Picon

Re: Problem with Java anda xml-rpc


On 6 Sep 2007, at 09:15, luisicozgz wrote:

> Hello,
>
> I want to communicate Java and PHP with XML-RPC but I have the next
> exception:
>
> Failed to parse servers response: Expected methodResponse element,
> got br

Looks like you are getting HTML back.

You are probably not using the right URL for the request.

John Wilson

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/xml-rpc/join
    (Yahoo! ID required)

(Continue reading)

luisicozgz | 6 Sep 2007 15:17
Picon
Favicon

Problem with type Date

Hello,

I need to send a variable type Date from Java to PHP with XML-RPC.I 
send the Date on this way:
Date a = new Date(2007,9,5);
params.addElement(a);
client.execute(funcion,params);
but when I send the Date, I have this error in the http sniffer:

<br />

<b>Warning</b>: pg_exec(): Query failed: ERROR: invalid input syntax 
for type date: &quot;--20070905T00:00:00&quot; in 
<b>/var/www/html/dev/sonia/casas_rurales/html/web/datos/conexion.clas
s.php</b> on line <b>109</b><br />

SQL: SELECT distinct(alojamiento_id) as alojamiento_id, 
fecha_entrada,fecha_salida,numero_habitacion,nombre_zona, 
city,province,idtypelodging FROM 
v_habitacion_alojamiento_disponibilidad WHERE province ~* '8' and 
idtypelodging = '8' and alojamiento_id in (SELECT alojamiento_id 
FROM v_suma_capacidad_alojamiento WHERE suma_maxima_capacidad ='8' ) 
and numero_habitacion = '8' and alojamiento_id not in (select 
alojamiento_id from v_habitacion_alojamiento_disponibilidad where ('-
-20070905T00:00:00' between fecha_entrada and fecha_salida) or ('--
20070905T00:00:00' between fecha_entrada and fecha_salida))

Error: ERROR: invalid input syntax for type date: "--
20070905T00:00:00"<br>

(Continue reading)

Stephane Bortzmeyer | 7 Sep 2007 15:12
Picon

Re: Problem with type Date

On Thu, Sep 06, 2007 at 01:17:04PM -0000,
 luisicozgz <luisicozgz <at> yahoo.com> wrote 
 a message of 474 lines which said:

> <b>Warning</b>: pg_exec(): Query failed: ERROR: invalid input syntax 
> for type date: &quot;--20070905T00:00:00&quot; 

This is a PostgreSQL error (pg_exec is a PostgreSQL call), not a PHP
one. The syntax of the date looks OK (tested with my PostgreSQL)
except the first two dashes. You'll have to find out which program
added these two dashes.

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/xml-rpc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:xml-rpc-digest <at> yahoogroups.com 
    mailto:xml-rpc-fullfeatured <at> yahoogroups.com

<*> To unsubscribe from this group, send an email to:
(Continue reading)

luisicozgz | 10 Sep 2007 12:14
Picon
Favicon

Problem with UTF-8

Hello,

I have executed the next line in Java

Object[] params = new Object[]{"a","b","c","d"}; 

params = (Object[])client.execute("function_bb",params);

Although in the Java Console I have the next error:

[Fatal Error] :521:16: Invalid byte 2 of 2-byte UTF-8 sequence.
org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse 
servers response: Invalid byte 2 of 2-byte UTF-8 sequence.

Can somebody help me?

Thanks a lot

    	

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
(Continue reading)

Paul Libbrecht | 10 Sep 2007 13:10

Re: Problem with UTF-8

The message says it all: Failed to parse servers response.
Could you activate the debug to see the server-response-document?
paul

Le 10 sept. 07 à 12:14, luisicozgz a écrit :

> [Fatal Error] :521:16: Invalid byte 2 of 2-byte UTF-8 sequence.
> org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse
> servers response: Invalid byte 2 of 2-byte UTF-8 sequence.
>
> Can somebody help me?

[Non-text portions of this message have been removed]

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/xml-rpc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:xml-rpc-digest <at> yahoogroups.com 
    mailto:xml-rpc-fullfeatured <at> yahoogroups.com
(Continue reading)

luisicozgz | 10 Sep 2007 16:09
Picon
Favicon

Re: Problem with UTF-8

Hello,

The console shows the following thing:

[Fatal Error] :521:16: Invalid byte 2 of 2-byte UTF-8 sequence.
org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse 
servers response: Invalid byte 2 of 2-byte UTF-8 sequence.
	at 
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse
(XmlRpcStreamTransport.java:177)
	at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest
(XmlRpcStreamTransport.java:145)
	at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest
(XmlRpcHttpTransport.java:94)
	at 
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest
(XmlRpcSunHttpTransport.java:44)
	at org.apache.xmlrpc.client.XmlRpcClientWorker.execute
(XmlRpcClientWorker.java:53)
	at org.apache.xmlrpc.client.XmlRpcClient.execute
(XmlRpcClient.java:166)
	at org.apache.xmlrpc.client.XmlRpcClient.execute
(XmlRpcClient.java:136)
	at org.apache.xmlrpc.client.XmlRpcClient.execute
(XmlRpcClient.java:125)
	at comunicacion.<init>(comunicacion.java:86)
	at Main.main(Main.java:9)
Caused by: org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte 
UTF-8 sequence.
	at 
(Continue reading)

Stephane Bortzmeyer | 10 Sep 2007 16:31
Picon

Re: Problem with UTF-8

On Mon, Sep 10, 2007 at 02:09:38PM -0000,
 luisicozgz <luisicozgz <at> yahoo.com> wrote 
 a message of 518 lines which said:

> <member><name>direccion</name>

Is it really direccion and not dirección? Because the result you
posted has only ASCII characters so I really do not see how it could
raise UTF-8 problems.

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/xml-rpc/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:xml-rpc-digest <at> yahoogroups.com 
    mailto:xml-rpc-fullfeatured <at> yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    xml-rpc-unsubscribe <at> yahoogroups.com

(Continue reading)


Gmane