• 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

how to set cookies (jsessionid) in web service client

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The below is my client code.

public static void main(String[] args) {
TestService ts = new TestService();
try {


SecurityEndpointImplServiceLocator loc = new SecurityEndpointImplServiceLocator();

SecurityEndpointImpl impl = loc.getWSSecurityService();

SOAPHeaderElement header = new SOAPHeaderElement("", "Security");
SOAPElement node = header.addChildElement("UsernameToken");
SOAPElement userNode = node.addChildElement("Username");
userNode.addTextNode("user");

SOAPElement passwordNode = node.addChildElement("Password");
passwordNode.addTextNode("password");

WSSecurityServiceSoapBindingStub stub = new WSSecurityServiceSoapBindingStub();

UserContext context = new UserContext();

/*
* SOAPHeaderElement header= new SOAPHeaderElement();
* stub.setHeader(header)
*/
context.setXXX("XXX");

((WSSecurityServiceSoapBindingStub) impl).setHeader(header);

SecurityParamResponse response = impl.getSecurityParam(context);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}


how can i set cookies in this code.
i was able to set SOAPHeaders.

i need to set jsession id value which i would be recieving from other service.

Thanks in advance.

 
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. Please see if this helps.
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic