8 Replies Latest reply on Apr 10, 2012 5:27 AM by gauthamr

    Camel CXF Schema Validation

    gauthamr

      Hi,

       

      Even after adding schema validation property to my cxf endpoint, my service is not validating the incoming request. Can someone please help me out in this?

       

       

        • 1. Re: Camel CXF Schema Validation
          ffang

          Hi,

           

          Most likely the servicemodel build from class but not from the wsdl, so can't pick up the schema infos, you can add wsdlLocation for your cxfEndpoint to force to build from wsdl to see if it helps.

           

          Freeeman

          • 2. Re: Camel CXF Schema Validation
            gauthamr

            Hi ,

             

            I did specify wsdl url but still its not validating the incoming xml. Is there any other setting i have to do?

             

             

             

             

            Regards,

            • 3. Re: Camel CXF Schema Validation
              njiang

              What dataformat are you using ?

               

              POJO, MESSAGE or PAYLOAD

               

              Willem

              • 4. Re: Camel CXF Schema Validation
                gauthamr

                Hi,

                 

                I actually tried with every format, but still no validation exception occured.

                 

                Tried with default format as

                 

                Regards,

                • 5. Re: Camel CXF Schema Validation
                  njiang

                  Which version of Camel are you using?

                  If I remember right there are properties related bug was found last year.

                   

                  Willem

                  • 6. Re: Camel CXF Schema Validation
                    gauthamr

                    Hi,

                    I am using 2.7.3-fuse-00-53 version of camel.

                    Also i have noticed that only the cardinality of the fields is being verified as part of cxf's schema validation property being set it true. I guess this is because of service class reference to the java class having those XMLElement's defined.

                    Since there is no xsd reference I am not able to verify schema restrictions such as length restrictions and so on.

                     

                    Kindly help me out in this.

                     

                    Regards,

                    Gautham

                    • 7. Re: Camel CXF Schema Validation
                      ffang

                      Hi,

                       

                      To do schema validation, you need build the servicemodel from wsdl, so that can pick up all the restriction details from xsd, could you check the log to see if there's any thing like

                       

                      Creating Service ****Service from WSDL ....(which means build servicemodel from wsdl, so the schema validation should be successfully performed) or Creating Service ****Service from class ... (which means build servicemodel from class, so the schema validation couldn't performed as the class has no restriction details)

                       

                      Freeman

                      • 8. Re: Camel CXF Schema Validation
                        gauthamr

                        Hi,

                        I even tried implementing cxf endpoint through wsdl as mentioned below but still now schema lenght restrictions are validated.

                        Can someone please help me out in this?

                         

                         

                         

                        ReflectionServiceFactoryBean   INFO  Creating Service WSEAddressUpdService from WSDL: /AcctInfo.wsdl