You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Charles Moulliard <ch...@gmail.com> on 2013/01/18 16:32:39 UTC

Strange issue using camel + cxf + policy

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

Re: Strange issue using camel + cxf + policy

Posted by Charles Moulliard <ch...@gmail.com>.
Find the reason. That was my mistake NotAuthorizedUser -->
NotAuthorizedUserException
!


On Fri, Jan 18, 2013 at 4:32 PM, Charles Moulliard <ch...@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