• 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

WSSecurity headers programmatically

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

I'm trying to create SOAP Security Header programmatically, like here:



I'm trying to accomplish this with:

stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,"wasadmin");
stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,"wasadmin");

Needless to say, I'm not succeeding. I'm using WebSphere 6.0. Would someone please post the code for this. Thanks a bunch already.

RR
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The setProperty calls you mention are used for HTTP authentication, not WS-Sec authentication.

I've never tried to use WS-Sec programmatically; obviously, you could create those elements "by hand", and inject them into the message using SAAJ.

There's some (very short) mentioning of how to use WSS4J (the library most commonly used for WS-Sec) programmatically here.
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Like what Ulf has said, you should consider of using WSS4J. The documentation isn't very good, but it shouldn't be too difficult to do it.
http://ws.apache.org/wss4j/
 
Rasheem Rashi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks! I'll look into it.
 
If you look closely at this tiny ad, you will see five bicycles and a naked woman:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic