You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Michal <ca...@yahoo.com> on 2007/08/23 11:40:49 UTC

jsr181 - validating payload

I am having a jsr181 endpoint that follows 'contract first' paradigm with
following settings:

<jsr181:endpoint pojo="#myService" 
                   wsdlResource="classpath:my.wsdl" 
                   style="document"
                   typeMapping="jaxb2"
                   annotations="jsr181"
                   serviceInterface="myclass" />

I am using wsgen task to generate all mapping classes. 
I have noticed that I can send invalid payload message to this service and
it will not complain. While debugging I have noticed a parameter in xfire:
org.codehaus.xfire.jaxb2.JaxbType.ENABLE_VALIDATION. After turning it on in
debbuger the payload is validated.

I figured out that this property could be turned on in
Jsr181Endpoint.registerService method by inserting following line:

getXFireService().setProperty(JaxbType.ENABLE_VALIDATION,
Boolean.TRUE.toString());


As a workaround I could write a custom Jsr181ExchangeProcessor which somehow
would inject this property. However, the problem is that there is no setter
for processor property. 


Is there any other way to achive automatic validation of the payload? Maybe
I did not configure my service correctly?
Shall I raise JIRA enhancment for this endpoint?


Michal



-- 
View this message in context: http://www.nabble.com/jsr181---validating-payload-tf4316406s12049.html#a12290428
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: jsr181 - validating payload

Posted by Nodet Guillaume <gn...@gmail.com>.
What about raising a JIRA?.
Validation should be enabled by a simple boolean property on the  
enpoint.
Wanna submit a patch for that?

Cheers,
Guillaume Nodet

On Aug 23, 2007, at 11:40 AM, Michal wrote:

>
> I am having a jsr181 endpoint that follows 'contract first'  
> paradigm with
> following settings:
>
> <jsr181:endpoint pojo="#myService"
>                    wsdlResource="classpath:my.wsdl"
>                    style="document"
>                    typeMapping="jaxb2"
>                    annotations="jsr181"
>                    serviceInterface="myclass" />
>
> I am using wsgen task to generate all mapping classes.
> I have noticed that I can send invalid payload message to this  
> service and
> it will not complain. While debugging I have noticed a parameter in  
> xfire:
> org.codehaus.xfire.jaxb2.JaxbType.ENABLE_VALIDATION. After turning  
> it on in
> debbuger the payload is validated.
>
> I figured out that this property could be turned on in
> Jsr181Endpoint.registerService method by inserting following line:
>
> getXFireService().setProperty(JaxbType.ENABLE_VALIDATION,
> Boolean.TRUE.toString());
>
>
> As a workaround I could write a custom Jsr181ExchangeProcessor  
> which somehow
> would inject this property. However, the problem is that there is  
> no setter
> for processor property.
>
>
> Is there any other way to achive automatic validation of the  
> payload? Maybe
> I did not configure my service correctly?
> Shall I raise JIRA enhancment for this endpoint?
>
>
> Michal
>
>
>
> -- 
> View this message in context: http://www.nabble.com/jsr181--- 
> validating-payload-tf4316406s12049.html#a12290428
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>