Just to be sure, are you using HTTP?

Also, are you using the Jetty HTTP destination on the server side, or Tomcat?

On Aug 31, 2007, at 1:13 PM, Chris Campbell wrote:

The AuthorizationPolicy is null in the server interceptor.

Now my client does this

BindingProvider bp = (BindingProvider)client;           
java.util.Map<String, Object> context = bp.getRequestContext();           
context.put(javax.xml.ws.BindingProvider.USERNAME_PROPERTY, "foouser"); context.put(javax.xml.ws.BindingProvider.PASSWORD_PROPERTY, "foopass");

My server interceptor does this (it is a Phase.USER_LOGICAL in
interceptor)

// policy is always null here...
AuthorizationPolicy policy = message.get(AuthorizationPolicy.class);
String username = policy.getUserName();
String password = policy.getPassword();

Thanks.

Daniel Kulp wrote:
On Thursday 30 August 2007, Chris Campbell wrote:
On client I have:

java.util.Map<String, Object> context =
        ((javax.xml.ws.BindingProvider)client).getRequestContext();
context.put("username", "chris");
context.put("password", "foobar");

How do I access that context on the server side in my interceptor? I
cannot seem to find where it is in the Message object, or am I
horribly misunderstanding something?

With those keys, they wouldn't get to the server. You would need to
use the BindingProvider.* keys.

On the server side in an interceptor, you should be able to do:
AuthorizationPolicy policy = message.get(AuthorizationPolicy.class);




Reply via email to