1 2 Previous Next 22 Replies Latest reply on Jun 25, 2010 6:43 AM by Laura Korta

    No tests for @SchemaValidation annotation in 3.0.1 ?

    l p Newbie

      In the distribution of 3.0.1 I cannot find any test for the @SchemaValidation annotation on a webservice, is this already supported ?

      Cheers, Luc.

        • 1. @SchemaValidation annotation does not seem to work
          l p Newbie

          Also, when I add this to my webservice:

          @SchemaValidation( enabled=true, errorHandler=nl.kb.hrd.dd.karakterisering.impls.ValidationErrorHandler.class, schemaLocation="ergens")

          and send an invalid request, nothing happens (or seems to happen). The request just gets passed, the handler is not called, and I see no errormessage about the invalid schemaLocation.

          A related question: in the JAX-WS RI, it does not seem to be necessary to specify the schema location. Why is it needed here ?

          • 4. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
            l p Newbie

            Hi Thomas,

            I am probably overlooking something, because I cannot find a proper test for the @SchemaValidation annotation.

            There are two endpoint classes, org.jboss.test.ws.jaxws.jbws1172.ValidatingEndpoint.java and NonValidatingEndpoint.java

            The annotation processor processes the @SchemaValidation annotation by adding the relevant feature to the endpoint.

            However, in JBWS1172TestCase.java, the testcases ignore the defined endpoints, and instead add the validating feature to endpoints defined in the testcode. So, to me it seems the handling of the @SchemaValidation annotation is not tested here. Is there another test for this maybe ?

            Cheers, Luc.

            • 5. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
              l p Newbie

              Another sign that I am probably missing something: In the jaxws source I cannot find any reference to the class

              SchemaValidationFeature

              of which an instance is added to the endpoint (except in the processor doing this). So looking at the source I have here (which must be incomplete) it seems it is added to the endpoint but never used.

              Cheers, Luc.

              • 6. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
                l p Newbie

                ...never mind, found it. My bad.

                The question about where the annotation is tested remains.

                Cheers, Luc.

                • 7. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
                  l p Newbie

                  Hi,

                  > The question about where the annotation is tested remains.

                  And still remains...maybe I should repeat what the question was, so people do'nt have to search for it by looking through all previous posts.

                  The question was:

                  I am probably overlooking something, because I cannot find a proper test for the @SchemaValidation annotation.

                  There are two endpoint classes, org.jboss.test.ws.jaxws.jbws1172.ValidatingEndpoint.java and NonValidatingEndpoint.java

                  The annotation processor processes the @SchemaValidation annotation by adding the relevant feature to the endpoint.

                  However, in JBWS1172TestCase.java, the testcases ignore the defined endpoints, and instead add the validating feature to endpoints defined in the testcode. So, to me it seems the handling of the @SchemaValidation annotation is not tested here. Is there another test for this maybe ?

                  If I cannot get this to work, I am considering switching to the metro implementation, which should have support for this (added november last year I think).

                  Cheers, Luc.

                  • 8. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
                    l p Newbie

                    Hi,

                    I am still hoping someone can answer this question for me. Is there a testcase for the @SchemaValidation annotation ?

                    Cheers, Luc.

                    • 9. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
                      Richard Opalka Master

                      See org/jboss/test/ws/jaxws/jbws1172/* test.
                      You can find it in jbossws-3.0.1-native-2.0.4.GA-src.zip archive

                      • 10. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
                        l p Newbie

                        Hi Richard,

                        Thanks for the reply. As mentioned in the previous posts, I already got the source from jbossws-3.0.1-native-2.0.4.GA-src.zip and examined the org/jboss/test/ws/jaxws/jbws1172/* tests. This caused me to wonder if I missed something, because there I did _not_ find a test for the annotation. Quoting myself:

                        "I am probably overlooking something, because I cannot find a proper test for the @SchemaValidation annotation.

                        There are two endpoint classes, org.jboss.test.ws.jaxws.jbws1172.ValidatingEndpoint.java and NonValidatingEndpoint.java

                        The annotation processor processes the @SchemaValidation annotation by adding the relevant feature to the endpoint.

                        However, in JBWS1172TestCase.java, the testcases ignore the defined endpoints, and instead add the validating feature to endpoints defined in the testcode. So, to me it seems the handling of the @SchemaValidation annotation is not tested here. Is there another test for this maybe ? ".

                        If the question is not clear please let me know and I will try to clarify.

                        Cheers, Luc.

                        • 11. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
                          l p Newbie

                          A reply would be appreciated !

                          • 12. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
                            l p Newbie

                            A reply would still be appreciated. Does the schema validation feature really work ?

                            Cheers, Luc.

                            • 13. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
                              l p Newbie

                              A reply would _really_ be appreciated. I know that support here is on a best effort basis, but I am still hoping to get a useful answer to this (imho) simple question.

                              Regards, Luc.

                              • 14. Re: No tests for @SchemaValidation annotation in 3.0.1 ?
                                Ana Holzbach Newbie

                                Hi,

                                To answer ljgp ("does the schema validation feature really work?"), I've implemented a service endpoint that uses SchemaValidation and it seems to work. I started with an xsd, generated jaxb objects from it and implemented my endpoint using those jaxb objects and the @WebService and @WebMethod annotations. Upon deployment the WSDL was automatically generated. Then I added the @SchemaValidation tag and ran into problems with multiple schema elements and multiple namespaces, because the generated wsdl had one schema for the jaxb objects and another one (with a different namespace) for binding, service, message, portType, etc. I solved that by editing the wsdl to consolidate everything into one schema tag with one namespace and added that edited wsdl locally to my application under META-INF/wsdl. I also had to add minOccurs=1 and maxOccurs=1 in places, since the wsdl's schema ended up with less information than my original schema.

                                A call to this webservice with a message that does not conform to the schema results in an Exception which is thrown by the StrictlyValidErrorHandler and wrapped in a SOAP Fault - something like:

                                org.xml.sax.SAXException: cvc-complex-type.2.4.b: The content of element 'specimen' is not complete. One of '{specimen_id}' is expected.
                                


                                1 2 Previous Next