users@glassfish.java.net

How to authenticate java web services from . net client

From: Thilini Amarasingha <thilini_narmada_at_yahoo.com>
Date: Thu, 30 Dec 2010 17:13:49 +0800 (SGT)

Hi,
 
 I'm trying to access java web service, protected with JAAS role based security
from C Sharp .net client..

 They are implemented as stateless EJB and deploying to glassfish V2.
 I have been successful in configuring JAAS security for the rest of my J2EE
Application and @rolesallowed annotation for ejb and it works well.
 Now I'm trying to set @rolesallowed annotation for my web services.
 
Consider the following example:-
 
 @WebService()
 @Stateless()
 @BindingType(value =
"http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/")
 public class DivService
 {
 @EJB
 private DivRemote ejb;

 @WebMethod(operationName = "getAllDivs")
 @RolesAllowed("Admin")
 public List<Division> getAllDivs() throws DAONotFoundException
 {
 return ejb.getAllDivs();
 }
 
 }
 
I can invoke the above web services from C Sharp .net client Without setting
@rolesallowed to them. When i try to invoke web services with the role based
securtiy i get an error from the client side says that the user is unauthorized.

So is there any way to authenticate web services from c sharp.net client by
using the user credentials??


Thanks & Best Regards,
Thilini