Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to maintain Maintaining session problem in webservice client... Save and send cookie? (Maintaining session problem in webservice client... Save and send cookie? )
How to maintain Maintaining session problem in webservice client... Save and send cookie? [message #1833079] Thu, 01 October 2020 19:25 Go to next message
david smith is currently offline david smithFriend
Messages: 1
Registered: October 2020
Junior Member
I have recently switched to programming in Java after programming for a while in C++, so bare with me if I ask dumb questions Smile ... In the company I work I have a situation which requires me to connect to a webservice.

I have used WSDL2Java successfully to generate the stub from the WSDL. I can connect and login to the webservice, but for some reason I cannot keep the session active. I send the login request, I receive the correct response, together with the cookie. The thing is I don't know how to extract it and send it along...

I have tried to myStub._getServiceClient().getOptions().setManageSession(tru e) but that doesn't seem to work. Is there any way to extract the cookie string from the response I get to the login request and then pass it to the following data request?

This is what I have got until now:

X1OrderServiceStub stub = new X1OrderServiceStub();
X1OrderServiceStub.Login request= new X1OrderServiceStub.Login();
request.setEmail("something@somewhere.com");
request.setPassword("thanks");
System.out.println("Request : " + request.toString());
X1OrderServiceStub.LoginResponse response= stub.Login(request);
System.out.println("Response : " + response.toString());

X1OrderServiceStub.AccountsList request2= new X1OrderServiceStub.AccountsList();
System.out.println("Request : " + request2.toString());
X1OrderServiceStub.AccountsListResponse response2= stub.AccountsList(request2);
System.out.println("Response : " + response2.toString()); // Result is session expired or not logged

Thank you very much!
eclipse
Re: How to maintain Maintaining session problem in webservice client... Save and send cookie? [message #1833097 is a reply to message #1833079] Fri, 02 October 2020 07:54 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31844
Registered: July 2009
Senior Member
This isn't a question about Eclipse's Java Development Tools. It isn't really even a question that's directly Eclipse related. It would be best to find a forum for asking about the specific framework you are using, or somewhere general like stackoverflow.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Problems with run configurations dialog
Next Topic:Missing Features
Goto Forum:
  


Current Time: Wed Apr 21 15:17:58 GMT 2021

Powered by FUDForum. Page generated in 0.01810 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top