I am trying to call a secured web service from a SLSB. I have injected the port 
using @Resource but get a connection exception because the credentials are not 
set. I have come up with a workaround to propagate the credentials (see below). 
But I would like to know if there is a standards based way to propagate 
credentials to the jaxrpc stub.

Do I just need to wait for the full JaxWS implementation in JBossWS 2.0?


@Stateless
  | @RolesAllowed(value = { "User" })
  | @SecurityDomain("portal")
  | public class AuthorizationCallbackServiceAdapterBean implements 
AuthorizationCallbackServiceLocal {
  | 
  |   @Resource(mappedName = 
"jbossws-client/service/AuthorizationCallbackService")
  |   protected AuthorizationCallbackService_PortType port;
  | 
  |   public void authorizationResponse(Long paymentId, Boolean status) {
  |      try {
  |       Stub stub = (Stub) port;
  |       stub._setProperty(Stub.USERNAME_PROPERTY, 
SecurityAssociation.getCallerPrincipal().getName());
  |       stub._setProperty(Stub.PASSWORD_PROPERTY, 
SecurityAssociation.getCredential());
  |          
  |       port.authorizationResponse(paymentId, status);
  | 
  |      } catch (Exception e) {
  |         throw new RuntimeException(e);
  |      }
  |   }
  | }
  | 

Calling SecurityAssociation and setting the properties on the stub is the 
prioritary workaround that i would like to avoid.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983812#3983812

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983812
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to