04.10.2012 Views

Handbuch ESR

Handbuch ESR

Handbuch ESR

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

There is another configuration file called user-pass-authenticate-client.xml. This file contains all the<br />

information necessary to ensure that the WS-Security extensions are included when generating the proxy<br />

classes.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Yellowworld.WSSecurirty.ClientSecurityEnvironmentHandler<br />

<br />

Fig 3: Contents of user-pass-authenticate-client.xml<br />

This configuration file defines that the SOAP request must contain a username token and a<br />

timestamp (as per WS-Security specification<br />

ht tp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0.pdf and<br />

ht tp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf).<br />

The framework automatically inserts this XML node at runtime. You do not have to do this.<br />

The only thing you may have to change here is the class name of the callback handler. In our case this is<br />

the ClientSecurityEnvironmentHandler. In this class you can define how you wish to read in the username<br />

and password, e.g. from a file, from a database, etc.<br />

Once you have made all the necessary changes, you can start generating the proxy classes with the ant<br />

tool. To do this, enter the following command on the command line:<br />

ant –f webserviceclient.xml<br />

15/19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!