You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Giuseppe Picone <gi...@gmail.com> on 2006/02/27 12:41:32 UTC
HTTP Redir with axis 1.3
I should implement an HTTP redirection (307 code) with Axis 1.3, both
from client side and from server side.
I must do the redir with Axis because it depends from the SOAP content.
I need Howto and some tip.
I'll appreciate also some example code
Thanks
Giuseppe
Fwd: HTTP Redir with axis 1.3
Posted by Giuseppe Picone <gi...@gmail.com>.
I should implement an HTTP redirection (307 code) with Axis 1.3, both
from client side and from server side.
I must do the redir with Axis because it depends from the SOAP content.
I need Howto and some tip.
I'll appreciate also some example code
Thanks
Giuseppe
Re: HTTP Redir with axis 1.3
Posted by Steve Loughran <st...@apache.org>.
Giuseppe Picone wrote:
> I should implement an HTTP redirection (307 code) with Axis 1.3, both
> from client side and from server side.
>
> I must do the redir with Axis because it depends from the SOAP content.
>
>
> I need Howto and some tip.
>
> I'll appreciate also some example code
>
> Thanks
> Giuseppe
>
I'm glad you are looking at 307 not 307, as ws-i forbids acting on 302.
For the 307 message they say
R1131 A CONSUMER MAY automatically redirect a request when it
encounters a "307 Temporary Redirect" HTTP status code in a response.
RFC2616 notes that user-agents should not automatically redirect
requests; however, this requirement was aimed at browsers, not automated
processes (which many Web services will be). Therefore, the Profile
allows, but does not require, consumers to automatically follow
redirections.
For the server, you'd need a new axis servlet that caught a custom
redirect exception, extracted the new path from the exception and
generated the appropriate message. I dont think anyone has done this yet.
For the client, I would target axis with the http-client library, as
this invariably has better handling of http things than Sun's own
library. you'd need to trace into the code to see what happens, and then
either
-silently put in a redirect
-recognise a 307 response, and create a new redirect exception,
containing the URL to use
-have the client code catch and act on the response
-add some loop detection code. After a finite number of redirects, you
should give up trying.
No sample code I'm afraid.
-steve