Hi,

you can validate your xml payload with the validation component: http://camel.apache.org/validation.html

Best regards - Claus

On 26.05.2011 17:03, Bruno Dusausoy wrote:
Hi,

I know this is a common question, but I couldn't find a simple answer for this. Basically what I want to do is to validate the input of my RESTful web service.
What I have is this camel context :

<camelContext xmlns="http://camel.apache.org/schema/spring";>
<route>
<from uri="cxfrs:///?resourceClasses=server.webservice.RestComputationService"/>
<bean ref="aBean"/>
<!-- other beans -->
<!-- ... -->
</route>
</camelContext>

with RestComputationService "implemented" as this :

public class RestComputationService implements ComputationService {

    @POST
    @Path("/computation")
    @Consumes("text/xml")
    @Produces("text/xml")
    @Override
    public Response compute(Request request) {
        return null;
    }
}

Request and Response classes are created from a schema with JAXB.
How can I use the validation against the payload when doing JAXB unmarshalling ?

Thanks in advance.

Regards.


Reply via email to