i created a simple webservice (EJB) which used the existing JDBCRealm:
==========
@WebService
public class HelloWorld {
@WebMethod
public String sayHelloWorldFrom() {
return "OK";
}
}
==========
<sun-ejb-jar>
<security-role-mapping>
<role-name>kitchen</role-name>
<group-name>kitchen</group-name>
</security-role-mapping>
<enterprise-beans>
<ejb>
<ejb-name>HelloWorld</ejb-name>
<jndi-name>HelloWorld</jndi-name>
<webservice-endpoint>
<port-component-name>HelloWorld</port-component-name>
<login-config>
<auth-method>BASIC</auth-method>
<realm>kitchen</realm>
</login-config>
</webservice-endpoint>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
======
with the correct login/password:
"127.0.0.1" "NULL-AUTH-USER" "04/Jun/2009:12:21:17 +0100" "POST /HelloWorldService/HelloWorld HTTP/1.1" 200 225
with an incorrect login/passwd:
"127.0.0.1" "NULL-AUTH-USER" "04/Jun/2009:12:28:26 +0100" "POST /HelloWorldService/HelloWorld HTTP/1.1" 401 1036
and my simple client gets:
Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: request requires HTTP authentication: Unauthorized
[Message sent by forum member 'dakol' (dakol)]
http://forums.java.net/jive/thread.jspa?messageID=349093