ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Ws Wiki] Update of "FrontPage/WsFx/refactor" by WernerDittmann
Date Mon, 06 Mar 2006 13:38:48 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.

The following page has been changed by WernerDittmann:

New page:
The directory contains new classes to handle WS
Security. The new classes have the same functionality as the old (depreceated)
classes but provide more flexibility to control the setup of the security

To minimize the migration effort every new class has a {{{build(...)}}} method that works
exactly as the known build method in the old classes. However, the new build
methods have slightly different method signatures.

The following table shows the old classes and their replacement with the new

||''Old class''                            ||''New class''||
||WS``Add``Signature``Confirmation     ||WS``Sec``Signature``Confirmation||
||WS``Add``Timestamp                   || WS``Sec``Timestamp||
||WS``Base``Message                    || WS``Sec``Base||
||WS``Encrypt``Body                    || WS``Sec``Encrypt||
||WSS``Add``SAMLToken                  || WS``Sec``SAML``Token||
||WSS``Add``Username``Token            || WS``Sec``Username``Token||
||WS``Sign``Envelope                   || WS``Sec``Signature||
||WS``Sign``SAML``Envelope (in *.saml) || WS``Sec``Signature``SAML||

Because of the refactoring we need the new class {{{WSSecHeader}}} to instantiate a
WS Security header. The following code snippets show how to use the new
classes and how it compares to the old classes.

First the code snippet that shows the flow using the old classes:
Document doc = ....;

WSEncryptBody builder = new WSEncryptBody();
Document encryptedDoc =, crypto);

And here the flow with the new classes:

Document doc = .... ;
WSSecEncrypt builder = new WSSecEncrypt();

WSSecHeader secHeader = new WSSecHeader();

Document encryptedDoc =, crypto, secHeader);

As you see you have to create the `WSSecHeader` and call its
{{{insertSecurityHeader(...)}}} method before you can call the build of {{{WSSecEncrypt}}}.
build method requires the {{{WSSecHeader}}} as last parameter. The {{{WSSecHeader}}}
provides constructors and setter methods to initialize the actor/role and
mustUnderstand attributes.

'''The use of the old classes is depreceated.'''

View raw message