As the good reverend said. The example below uses the file scope for authentication.
@Stateless
@WebService(name = "MyAppServices")
@RolesAllowed({"user"})
public class ItemEJB {
...
}
You will also need sun-ejb-jar.xml , for example.
<sun-ejb-jar>
<security-role-mapping>
<role-name>user</role-name>
<group-name>user</group-name>
</security-role-mapping>
<enterprise-beans>
<ejb>
<ejb-name>ItemEJB</ejb-name>
<webservice-endpoint>
<port-component-name>MyAppServices</port-component-name>
<login-config>
<auth-method>BASIC</auth-method>
<realm>file</realm>
</login-config>
</webservice-endpoint>
</ejb>
</enterprise-beans>
( ).