• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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="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.
 
It's never done THAT before. Explain it to me tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic