Hi,
I am trying to implement SecureConversation as defined in Rampart's
"\policy\sample04" example in the samples directory of the rampart-1.3
release.
The client sends several SOAP messages to the server[1]. The messages
are currently authenticated using the UsernameToken in PWCallback class.
[1] OMElement response = client.sendReceive(getPayload("Hello
world1"));
System.out.println("Response 1 : " + response);
response = client.sendReceive(getPayload("Hello world2"));
System.out.println("Response 2 : " + response);
response = client.sendReceive(getPayload("Hello world3"));
System.out.println("Response 3 : " + response);
Now my question is that every time I send a SOAP message the
authentication logic in PWCallback class[2] is also executed.
Is there a way to identify that all the consecutive messages are from
the same session so that the authentication will happen only once? In
short the authentication logic[2] should be ideally called only once.
[2] for (int i = 0; i < callbacks.length; i++) {
WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
String id = pwcb.getIdentifer();
if("client".equals(id)) {
pwcb.setPassword("apache");
} else if("service".equals(id)) {
pwcb.setPassword("apache");
}
}
Thanks in advance.
Bhushan Gupte