Amit, You and Ashwin have posed this question several times, and we've answered. I'll type in the answer again.
If you simply turn on schema validation, you'll get the standard fault we define for schema validation. If you code an interceptor, you could change the fault. If you really want to do it yourself, use a Provider to get the XML instead of having CXF map. --benson On Thu, Jun 11, 2009 at 9:50 AM, Amit Rathi<[email protected]> wrote: > Hi, > We are using CXF2.1 for our web service development and facing one issue. We > need to parse the input request and ensure that it is as per the XSD, else > need to throw customized exception. Currently while using CXF2.1, inside the > service class where we are writing the business logic, inside the method we > are directly getting the Value Object, which contains the value extracted > from input request. We need to get the complete input request so that we can > parse it and take necessary steps. > > This is the sample request > > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:x20="http://soapheader.ibm.com/"> > <soapenv:Header> > <x20:aheader1>?</x20:aheader1> > <x20:bheader2>?</x20:bheader2> > </soapenv:Header> > <soapenv:Body> > <x20:crequest`> > <x20:dvar1> > <x20:evar2>as</x20:evar3> > </x20:dvar1> > </x20:crequest> > </soapenv:Body> > </soapenv:Envelope> > > We want to read it, as it is in my service class. > But i am unable to read it. > When I tried to read the request in my service class by ( requestObject or > requestObject.toString ), it gives me the object name not the input request > in a String format. > > We have also tried the below code as per my paths & files. We put this in > cxf.xml in cxf-2.1.jar & tested with new jar, it deployed properly & ran also > but still its not giving me the schema validation facility i.e. still we are > not able to validate or input request as per the xsd. > > For the client side > > <jaxws:client name="{http://apache.org/hello_world_soap_http}SoapPort" > > createdFromAPI="true"> > > <jaxws:properties> > > <entry key="schema-validation-enabled" value="true" /> > > </jaxws:properties> > > </jaxws:client> > > For the server side > > <jaxws:endpoint name="{http://apache.org/hello_world_soap_http}SoapPort" > > wsdlLocation="wsdl/hello_world.wsdl" > > createdFromAPI="true"> > > <jaxws:properties> > > <entry key="schema-validation-enabled" value="true" /> > > </jaxws:properties> > > </jaxws:endpoint> > > > > Is there any thing else we have to do ? > Please guide me on same. > > Thanks & regards > Amit > >
