wood burning stoves 2.0*
The moose likes Web Services and the fly likes Stub generated using Axis2 Webservice creates new connection for redirect URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Stub generated using Axis2 Webservice creates new connection for redirect URL" Watch "Stub generated using Axis2 Webservice creates new connection for redirect URL" New topic
Author

Stub generated using Axis2 Webservice creates new connection for redirect URL

Mohsin Jafri
Greenhorn

Joined: Oct 01, 2012
Posts: 1
Hello Friends,

I am badly stuck with a SOAP based integration using Axis2 framework for generation of client stubs from the Server WSDL. The scenario is as follows:-

1. There is always a login API call first, which gives a Success response in SOAP body and Temporary Redirect in HTTP header. Also provides a URL which contains the session ID in the Location field of HTTP Header.
2. The next API call is required to be made at this redirect location. IN THE SAME TCP CONNECTION, for getting a proper response.
3. Now, the problem is, as a part of Webservice implementation using Axis2 generated stubs, I need to reload this redirect URL and re-instantiate it as --- "stub=new Stub(newurl)"
As soon as this is done, it creates a new TCP connection and so, the next request gives the response as "session ID invalid" because it goes out-of-sync with login API.

I have tried everything mentioned as a solution in web and nothing is working out. For e.g --

MultiThreadedHttpConnectionManager httpConnectionManager = new MultiThreadedHttpConnectionManager(); HttpClient httpClient = new HttpClient(httpConnectionManager);

ServiceClient serviceClient = stub._getServiceClient();
Options opts = stub._getServiceClient().getOptions();

opts.setTo(new EndpointReference(prop.getProperty("target_end_point_url")));
opts.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE);
opts.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);

serviceClient.setOptions(opts);

stub._setServiceClient(serviceClient);

Similarly, I have tried many other options too. But its not helpful at all.

Please help me find a solution. I need it very urgently.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stub generated using Axis2 Webservice creates new connection for redirect URL