You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by yuncil <jo...@hotmail.de> on 2014/06/06 11:09:03 UTC

CXF Endpoint accepts invalid SOAP-Envelope in POJO-Mode

Hello,

we developed a webservice with cxf and camel. Everything works fine, except
the fact that the cxf-endpoint accepts invalid SOAP-Messages. 

For example we have a SOAP-Message:

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header>
     ...
    </SOAP-ENV:Header>

    <SOAP-ENV:Body>
       ...
     </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


But we observed that it isn't necessery to spell the "SOAP-ENV:Envelope"-Tag
correctly.

CXF accepts every combination like: <SOAP-ENV:foo ..., > <SOAP-ENV:bar...>,
<SOAP-ENV:blabla...> . In addition the start and end tag doesn't have to
match eachother, it's also possible to type:

<SOAP-ENV:foo xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

   <SOAP-ENV:Header>
     ...
   </SOAP-ENV:Header>

   <SOAP-ENV:Body>
       ...
   </SOAP-ENV:Body>

</SOAP-ENV:bar>

Here is the code:

Servlet:

public class CXFServlet extends CXFNonSpringServlet {

    @Override
    protected void loadBus(ServletConfig sc) {
       
        setBus(BusFactory.getDefaultBus());
    }

Camel:

public class CamelRoute extends RouteBuilder {

    private static final Logger logger = Logger.getLogger(CamelRoute.class);

    private final String uri = "cxf:/rrv?dataFormat=PAYLOAD";

    @Override
    public void configure() throws Exception {

            from(uri)
              .process(new Processor() {

                @Override
                public void process(Exchange exchange) throws Exception {
                    processSOAP(exchange);
                }
            });
    }

The processSOAP method just prints the SOAP-Message and create a response.

Do we miss some configuration? Or is there a workaround for this problem? In
the end we always get a SOAP-Response instead of a SOAP-Fault.

It might be funny but this time i really looking forward to see an exception
thrown.

PS: We don't want to use spring, so i would prefer a non-spring solution. 

thank you for your time.








--
View this message in context: http://camel.465427.n5.nabble.com/CXF-Endpoint-accepts-invalid-SOAP-Envelope-in-POJO-Mode-tp5751971.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF Endpoint accepts invalid SOAP-Envelope in POJO-Mode

Posted by yuncil <jo...@hotmail.de>.
Hi Aki,

we were also astonished first. It took some time to realize that it's just
the element-name. 

Thank you for your help. We will try it again when the issue is fixed.

Regards



--
View this message in context: http://camel.465427.n5.nabble.com/CXF-Endpoint-accepts-invalid-SOAP-Envelope-in-POJO-Mode-tp5751971p5752344.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF Endpoint accepts invalid SOAP-Envelope in POJO-Mode

Posted by Aki Yoshida <el...@gmail.com>.
Hi Jonas,
I created a jira ticket CXF-5805 at the CXF project and linked to this
mail thread.

thanks.
regards, aki

2014-06-13 20:47 GMT+02:00 Aki Yoshida <el...@gmail.com>:
> just a minute.
> but this is likely to be not a camel issue but a cxf issue.
> so could you wait a little bit.
> thanks
>
>
>
> 2014-06-13 20:39 GMT+02:00 Aki Yoshida <el...@gmail.com>:
>> hi yuncil,
>>
>> i didn't believe it first. ;-)
>>
>> but indeed, i see a bogus envelope gets accepted. (but haven't had
>> enough time to look into it)
>> when the namespace is wrong, the request gets rejected, but when only
>> the element name is wrong, it gets processed.
>> we should fix this issue.
>> could you open a jira ticket?
>>
>> i'll look at it next week.
>> thanks.
>>
>> aki
>>
>> 2014-06-12 11:56 GMT+02:00 yuncil <jo...@hotmail.de>:
>>> Doesn't have anobody an idea? Is there no option to make sure that the
>>> incoming message is a valid SOAP-Request?
>>>
>>>
>>>
>>> --
>>> View this message in context: http://camel.465427.n5.nabble.com/CXF-Endpoint-accepts-invalid-SOAP-Envelope-in-POJO-Mode-tp5751971p5752195.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF Endpoint accepts invalid SOAP-Envelope in POJO-Mode

Posted by Aki Yoshida <el...@gmail.com>.
just a minute.
but this is likely to be not a camel issue but a cxf issue.
so could you wait a little bit.
thanks



2014-06-13 20:39 GMT+02:00 Aki Yoshida <el...@gmail.com>:
> hi yuncil,
>
> i didn't believe it first. ;-)
>
> but indeed, i see a bogus envelope gets accepted. (but haven't had
> enough time to look into it)
> when the namespace is wrong, the request gets rejected, but when only
> the element name is wrong, it gets processed.
> we should fix this issue.
> could you open a jira ticket?
>
> i'll look at it next week.
> thanks.
>
> aki
>
> 2014-06-12 11:56 GMT+02:00 yuncil <jo...@hotmail.de>:
>> Doesn't have anobody an idea? Is there no option to make sure that the
>> incoming message is a valid SOAP-Request?
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/CXF-Endpoint-accepts-invalid-SOAP-Envelope-in-POJO-Mode-tp5751971p5752195.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF Endpoint accepts invalid SOAP-Envelope in POJO-Mode

Posted by Aki Yoshida <el...@gmail.com>.
hi yuncil,

i didn't believe it first. ;-)

but indeed, i see a bogus envelope gets accepted. (but haven't had
enough time to look into it)
when the namespace is wrong, the request gets rejected, but when only
the element name is wrong, it gets processed.
we should fix this issue.
could you open a jira ticket?

i'll look at it next week.
thanks.

aki

2014-06-12 11:56 GMT+02:00 yuncil <jo...@hotmail.de>:
> Doesn't have anobody an idea? Is there no option to make sure that the
> incoming message is a valid SOAP-Request?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXF-Endpoint-accepts-invalid-SOAP-Envelope-in-POJO-Mode-tp5751971p5752195.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXF Endpoint accepts invalid SOAP-Envelope in POJO-Mode

Posted by yuncil <jo...@hotmail.de>.
Doesn't have anobody an idea? Is there no option to make sure that the
incoming message is a valid SOAP-Request?



--
View this message in context: http://camel.465427.n5.nabble.com/CXF-Endpoint-accepts-invalid-SOAP-Envelope-in-POJO-Mode-tp5751971p5752195.html
Sent from the Camel - Users mailing list archive at Nabble.com.