public void setSOAPMessage(Object message, ComponentInvocation inv) {
   if (inv instanceof EJBInvocation) {
     EJBInvocation eInv = (EJBInvocation) inv;
     if (eInv.isAWebService()) {
       eInv.setMessage(message);
     }
   }
 }
 public Object getSOAPMessage(ComponentInvocation inv) {
   if (inv instanceof EJBInvocation) {
     EJBInvocation eInv = (EJBInvocation) inv;
     if (eInv.isAWebService()) {
       // TODO:V3 does this violate JACC spec?, we may have to convert to SOAPMessage on demand
       // return eInv.getSOAPMessage();
       return eInv.getMessage();
     }
   }
   return null;
 }
 public Object getEJbArguments(ComponentInvocation inv) {
   if (inv instanceof EJBInvocation) {
     EJBInvocation eInv = (EJBInvocation) inv;
     if (eInv.isAWebService()) {
       return null;
     } else {
       return (eInv.getMethodParams() != null) ? eInv.getMethodParams() : new Object[0];
     }
   }
   return null;
 }
 public boolean isUserInRole(String role) {
   WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
   InvocationManager mgr = wscImpl.getInvocationManager();
   if (ComponentInvocation.ComponentInvocationType.EJB_INVOCATION.equals(
       mgr.getCurrentInvocation().getInvocationType())) {
     EJBInvocation inv = (EJBInvocation) mgr.getCurrentInvocation();
     boolean res = inv.isCallerInRole(role);
     return res;
   }
   // This is a servlet endpoint
   boolean ret = this.jaxwsContextDelegate.isUserInRole(role);
   // handling for webservice with WS-Security
   if (!ret && secServ != null) {
     if (mgr != null && mgr.getCurrentInvocation() != null) {
       if (mgr.getCurrentInvocation().getContainer() instanceof WebModule) {
         Principal p = getUserPrincipal();
         ret =
             secServ.isUserInRole(
                 (WebModule) mgr.getCurrentInvocation().getContainer(), p, servletName, role);
       }
     }
   }
   return ret;
 }