cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: FW: How to parse the input request and ensure that it is as per the XSD ?
Date Wed, 10 Jun 2009 18:06:05 GMT

As Benson pointed out, the best way to accomplish the schema validation part 
is to just let CXF (actually, jaxb) validate it during it's processing.   That 
would have the lowest overhead and highest performance.  

If you insist on doing it yourself, I'd recommend using a JAX-WS Handler.    
In the handler, you have the SAAJ message that you could feed into whatever 
validator you want and you can setup your faults and such as you need.

Dan



On Wed June 10 2009 3:24:49 am Edumudi, Viswanath wrote:
> -----Original Message-----
> From: Edumudi, Viswanath [CCC-OT]
> Sent: Wednesday, June 10, 2009 3:15 AM
> To: 'users-subscribe@cxf.apache.org'
> Subject: How to parse the input request and ensure that it is as per the
> XSD ?
>
> 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. Can someone
> please guide us how the same can be achieved?
>
>
> 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>
>
> I 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
> as it is.
>
> Please guide me on same.
>
> Thanks & regards
> Amit

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message