| Author |
Session ID is not valid. How to pass sessionid as part of header of soap message in jaxws client.
|
sridhar vempali
Greenhorn
Joined: Sep 10, 2012
Posts: 1
|
|
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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsh="http://www.informatica.com/wsh">
<soapenv:Header>
<wsh:Context>
<SessionId>?</SessionId>
</wsh:Context>
</soapenv:Header>
<soapenv:Body>
<wsh:Logout/>
</soapenv:Body>
</soapenv:Envelope>
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;
try
{
MetadataService service = new MetadataService();
inter = service.getMetadata();
req = new LoginRequest();
req.setRepositoryDomainName("DevDomain_02");
req.setRepositoryName("ETLRepDev_02");
req.setUserName("Administrator");
req.setPassword("et1admin");
sessionId = inter.login(req);
System.out.println("Session id=" + sessionId);
/*
SessionHeader sh = new SessionHeader();
sh.setSessionId(sessionId);
ObjectFactory factory = new ObjectFactory();
JAXBElement element = factory.createContext(sh);
*/
DIServerInfoArray diServersInfo = inter.getAllDIServers(new VoidRequest()); }
catch(Exception e)
{
e.printStackTrace();
}
finally
{
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.
|
 |
 |
|
|
subject: Session ID is not valid. How to pass sessionid as part of header of soap message in jaxws client.
|
|
|