cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin" <>
Subject RE: Spring Security annotations in CXF?
Date Fri, 05 Dec 2008 10:37:29 GMT

Thanks for posting the sample. So with no spring security,
GET /tryThis/1/bar 

gets delivered to the first method, while 
GET /tryThis/1

goes to another one with a single parameter.

But with spring security being on, it's not working. Hmm... - it's
something I'll have to investigate... I think it might be something to
do with all this AOP black art magic being involved :-) I'd try changing
the order of these two methods, and possibly push them to a separate
interface (alongside with JAXRS annotations) which MyService
implementing it...

Thanks, Sergey

Sergey Beryozkin-3 wrote:
>> If you don't add the <aop:scoped-proxy> and <aop:aspectj-autoproxy>
>> you'll encounter an error:  "object is not an instance of declaring
>> class."
>> The only problem I'm noticing right now is that method overloading
>> doesn't
>> work when using Spring's AOP stuff.  That's not a big deal, though,
>> right now I'm just ecstatic that spring-security is working.
> Is it on a JAXRS or JAXWS invocation path ? Can you post a sample java
> code please for "myServiceBean" ?

It's on a JAXRS invocation path.

------- -------
@Path( "/myService/" )
@ProduceMime( "application/xml" )
@WebService( name = "MyService" )
public class MyService {

    public MyService() {


    @Path( "/tryThis/{id}/{name} )
    @ProduceMime( "application/xml" )
    @Secured( "ROLE_ADMINISTRATOR" )
    public List<OurObject> tryThis( @PathParam( "id" ) String id,
@PathParam( "name" ) String name ) {

        // do stuff.

    @Path( "/tryThis/{id} )
    @ProduceMime( "application/xml" )
    @Secured( "ROLE_ADMINISTRATOR" )
    public List<OurObject> tryThis( @PathParam( "id" ) String id ) {

        return tryThis( id, "Fake Name" );

> Is 'provisioningBean' different to myServiceBean ?

No, sorry, provisioningBean should be myServiceBean.

I'm hoping to replace my my existing HTTP authentication with
I'll let you know how that goes.  :)

Thank you,
 - Dave
View this message in context:
Sent from the cxf-user mailing list archive at

View raw message