camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <ch0...@gmail.com>
Subject Re: Strange issue using camel + cxf + policy
Date Fri, 18 Jan 2013 16:22:00 GMT
Find the reason. That was my mistake NotAuthorizedUser -->
NotAuthorizedUserException
!


On Fri, Jan 18, 2013 at 4:32 PM, Charles Moulliard <ch007m@gmail.com> wrote:

> Hi,
>
> I have created a Camel route where the user is authenticated using JAAS &
> ws-security (works fine) ad authorized with Spring Security (works fine)
> but when the response is populated (IN A WRONG WAY) I get this error :
>
> ERROR
>
> https://gist.github.com/a56d18ca8585b9624787
>
> WSDL
>
> https://gist.github.com/fd3f8d0b95cc15ec157f
>
> CODE OF CAMEL
>
>     @Override
>     public void configure() throws Exception {
>
>         onException(CamelAuthorizationException.class)
>         .log(">> User not authorized")
>         .handled(true)
>                 .process(new Processor() {
>                     @Override
>                     public void process(Exchange exchange) throws
> Exception {
>                         String user = "jim";
>                         NotAuthorizedUser notAuthorizedUser = new
> NotAuthorizedUser();
>                         notAuthorizedUser.setUser(user);
>                         exchange.getOut().setBody(notAuthorizedUser);
>                         exchange.getOut().setFault(true);
>                     }
>                 });
>
>         from("cxf:bean:WS").id("cxf-to-client-pojo")
>
>           .beanRef("enrich", "convertToAuthenticationWithRealm")
>           .policy("admin")
>           ....
>
> QUESTION :
>
> Why Camel-CXF does not return a SOAP Fault message but
> GetByCustomerResponse containing the user string defined with
> NotAuthorizedUser object  ?
>
> Regards,
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message