cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amit Rathi" <amit.ra...@oracle.com>
Subject How to validate input request in CXF?
Date Thu, 11 Jun 2009 13:50:22 GMT
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 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message