Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Session ID is not valid. How to pass sessionid as part of header of soap message in jaxws client.  RSS feed

sridhar vempali
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting "Session ID is not valid." error while invoking "logout" webserivce call.

here is the "logout" XML request ( captured from soapui):-
<soapenv:Envelope xmlns:soapenv="" xmlns:wsh="">

After seeing this request XML message ( from Soap UI), I realized that I should pass SessionId in the header. I could not do this. please let me how to do this.

I generated java classes using WSDL in myeclipse ( jaxws).

Here is my test client code for reference :-
MetadataInterface inter = null;
LoginRequest req = null;
String sessionId = null;

MetadataService service = new MetadataService();

inter = service.getMetadata();

req = new LoginRequest();

sessionId = inter.login(req);

System.out.println("Session id=" + sessionId);

SessionHeader sh = new SessionHeader();

ObjectFactory factory = new ObjectFactory();
JAXBElement element = factory.createContext(sh);

DIServerInfoArray diServersInfo = inter.getAllDIServers(new VoidRequest()); }
catch(Exception e)
if( inter != null)
inter.logout(new VoidRequest()); }

please help me on how to pass session id in the context of header. login call is successful. After that , logout/getAllDIServers calls are throwing "Session ID is not valid" error.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!