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 Andrew Norman <an...@piczoinc.com> on 2007/01/03 21:07:08 UTC

when implementing redirects xml-rpc content is lost

All,
I'm using the apache XML-RPC server implementation as a second step of
an http redirect. The first step of the redirect is a servlet which
makes a response.sendRedirect(url) call with a modified url / query
string that routs the request to the second step which is my XML-RPC
Server based implementation. 

Testing the second part of the implementation (i.e. skipping the
redirect call) with the Apache XML-RPC client works fine; however, the
client is not successful when I test it with my redirect logic and get
the following behavior:

When I use the XmlRpcCommonsTransportFactory setting in the client the
redirect doesn't happen at all (because Apache's implementation forces
redirects to be disabled for all http posts).
When I use the XmlRpcSunHttpTransportFactory setting in the client the
redirect happens but the XML-RPC content appears to be corrupt or lost
as I get the following error:

[Fatal Error] :-1:-1: Premature end of file.
execute: Error while performing request
org.apache.xmlrpc.XmlRpcException: Failed to parse XML-RPC request:
Premature end of file.
	at
org.apache.xmlrpc.server.XmlRpcStreamServer.getRequest(XmlRpcStreamServe
r.java:66)
	at
org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.j
ava:181)
	at
org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletSer
ver.java:103)
	at
com.funtigo.xmlrpc.XmlRpcHelper.handleRpcRequest(XmlRpcHelper.java:80)


The behavior I want to implement is to have the original content of the
XML-RPC request get rerouted by the xml-rpc client to the target of the
URL/query string that is set by the redirect invoked by the first
servlet. Is there a customization point in Apache's client for
implementing this custom behavior (if this isn't considered normal
redirect handling)? If so what is it and how would I go about handling
this behavior?


Other information:
I'm running on Tomcat 4.1.x / java 1.4 / xml-rpc 3.0 using the standard
Xml-Rpc implementation settings (other than those mentioned above) 

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


Re: when implementing redirects xml-rpc content is lost

Posted by Jochen Wiedmann <jo...@gmail.com>.
On 1/3/07, Andrew Norman <an...@piczoinc.com> wrote:

> I'm using the apache XML-RPC server implementation as a second step of
> an http redirect.

That would require support in the transport layer, which isn't
implemented. I have no intention to work in that area, but would
consider patches.

Basically, the transport would need to check for a redirect before
accessing the input stream.


Jochen


-- 
My wife Mary and I have been married for forty-seven years and not
once have we had an argument serious enough to consider divorce;
murder, yes, but divorce, never.
(Jack Benny)

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org