This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes HttpServletResponse object in webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "HttpServletResponse object in webservice" Watch "HttpServletResponse object in webservice" New topic
Author

HttpServletResponse object in webservice

Bob Green
Ranch Hand

Joined: Feb 29, 2004
Posts: 93
Hi all,
I have a web application that calls a webservice and from the webservice, I need to get the HttpServletResponse object so that I can redirect to another page of my web application. My question is how to get the HttpServletResponse object from the webservice.

TIA,
Bob
Abelard Chow
Greenhorn

Joined: Jan 25, 2005
Posts: 7
Hi Bob,

I am sorry, but I don't think it is possible. By all means, HttpServletResponse is from the Servlet architecture; while, WebSerive is another kind of animal that use another set of libraries.

You can't use library A and try to find class X in there, where class X belongs to library B.

Anyone, if I am wrong, please correct me. Thanks

Abelard Chow


Abelard Chow<br /> <br />Some see things as where they were and ask why, I dream things that never are and ask why not.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35220
    
    7
While I agree that this is not possible, the reasons are different from the ones mentioned above. Most WS implementations are built on top of servlets, and at least some allow access to HttpServletRequest and Response objects. In Axis, e.g., the code for that would be something like this:


The problem is that WS clients do not expect to be sent redirect messages on an HTTP level, and certainly will not resubmit to a different URL if they get one. The proper thing to do is to send back an error message in the SOAP content which mentions that the WS has moved, and where it can now be found.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: HttpServletResponse object in webservice
 
Similar Threads
Jasper Reports and Webservices
getting null response while calling glue webservice
Looking for advices
Looking for a article or tutorial on setting up a web service client
passing primitive data types via webservices using WSAD and VisualStudion .NET