users@glassfish.java.net

Re: Howto call Webservice on JDBCRealm secured server

From: Kumar Jayanti <v.b.kumar.jayanti_at_oracle.com>
Date: Thu, 28 Jul 2011 15:44:12 +0530

Is that an EJB WebService ?.
There are multiple ways :

SOAP Message Security
------------------------------
1. Add some Security Policies to the WSDL (see this for a servlet example) :
http://netbeans.org/kb/docs/websvc/wsit.html
2. Use the legacy Security Provider in glassfish, in this case and the Client would need to be an Application Client.
http://download.oracle.com/docs/cd/E18930_01/html/821-2435/ablrn.html#ablrz

3. Enable Basic Auth if it is a Servlet WebService

On 28-Jul-2011, at 2:45 PM, forums_at_java.net wrote:

> Hi,
>
> I have a webservice running on Glassfish 3.1. I configured a JDBCRealm and
> added some annotations so some methods can only be called from admin users. I
> added the role mapping to glassfish-application.xml and the realm. The
> application is deployed without error. When I call the annotated methods i
> get a "Client not authorized..." exception. Everything as expected.
>
> My problem is on the client side. How can I login and call the Webservice? I
> couldn't find anything on this in the Glassfish documentation.
>
> Thanks,
>
> FK
>
>
> --
>
> [Message sent by forum member 'fk185']
>
> View Post: http://forums.java.net/node/826947
>
>