[jboss-user] [EJB 3.0] - EJB3.0 annotation security and webservices.

webmarck do-not-reply at jboss.com
Sat Oct 28 11:51:58 EDT 2006


I have a session bean where all methods look like this


  | @RolesAllowed("customer")
  | public void setName(String name);
  | 

Now I want to expose that method as a webservice but I have no idea on how to tell my client the username and password


  | URL url = new URL("http://localhost:8080/test/MyBean?wsdl");
  | QName qname = new QName("http://test.niro.dk/jaws",
  | 	              "MyService");
  | ServiceFactory factory = ServiceFactory.newInstance();
  | Service service = factory.createService(url, qname);
  | My myTest = (My)service.getPort(My.class);
  | myTest.setName("test");
  | 

So I of course get this exception


  | Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
  | at $Proxy0.resetDatabase(Unknown Source)
  | at dk.test.MyClient.main(MyClient.java:21)
  | Caused by: java.rmi.RemoteException: Call invocation failed with code [Client] because of: Authentication failure; nested exception is: 
  | javax.xml.rpc.soap.SOAPFaultException: Authentication failure
  | at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:715)
  | at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:398)
  | at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:164)
  | ... 2 more
  | Caused by: javax.xml.rpc.soap.SOAPFaultException: Authentication failure
  | at org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper.getSOAPFaultException(SOAPFaultExceptionHelper.java:100)
  | at org.jboss.ws.binding.soap.SOAPBindingProvider.unbindResponseMessage(SOAPBindingProvider.java:505)
  | at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:704)
  | ... 4 more
  | 

And the server throws a 

17:39:26,140 ERROR [SOAPFaultExceptionHelper] SOAP request exception
  | javax.ejb.EJBAccessException: Authentication failure
  | at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.handleGeneralSecurityException(Ejb3AuthenticationInterceptor.java:99)
  | at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:70)

Plzzzzz help!! 

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981533



More information about the jboss-user mailing list