1 Reply Latest reply on Jul 13, 2012 10:28 AM by pelgrim

    JAX-WS @SchemaValidation not being performed on Tomcat 7.0.23 (while on Glassfish it is)

    pelgrim

      Hello,

       

      I created a webservice on which I want Schema Validation to be performed.

       

      I added @Schemavalidation above the class declaration of the webservice.

      Deployment on both Glassfish and Tomcat works (same war-file).

      Sending correct request messages gives appropriate response on Glassfish and Tomcat, so the webservices works fine.

      But when I send:

       

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:nl:edsn:service:removemeterrequest:env:1" xmlns:urn1="urn:nl:edsn:abies:2" xmlns:urn2="urn:nl:edsn:service:c-ar:docs:1">

         <soapenv:Header/>

         <soapenv:Body>

            <urn:RemoveMeter>

      <!-- NOT SUPPOSED TO BE EMPTY -->

            </urn:RemoveMeter>

         </soapenv:Body>

      </soapenv:Envelope>

       

      Glassfish gives me the correct response:

       

      <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">

         <S:Body>

            <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">

               <faultcode>S:Client</faultcode>

               <faultstring>cvc-complex-type.2.4.b: The content of element 'urn:RemoveMeter' is not complete. One of '{"urn:nl:edsn:service:removemeterrequest:env:1":EDSNBusinessDocumentHeader}' is expected.</faultstring>

            </S:Fault>

         </S:Body>

      </S:Envelope>

       

      While Tomcat gives me a Java stacktrace because it can't handle the request.

       

      Does anyone know how this can be or how to solve it?

      Or maybe someone has just an idea about in which direction I should look?

       

      This is the same webservice I posted about 2 weeks ago.

      Discussion: Deployment error with @SchemaValidation.

       

      Thanks in advance.

       

      Best regards,

      Erik Pelgrim

        • 1. Re: JAX-WS @SchemaValidation not being performed on Tomcat 7.0.23 (while on Glassfish it is)
          pelgrim

          After two days of trying I finally got it to work on Tomcat.

          Apperantly Tomcat does not support JAXWS-RI by default, which was needed, so I had to switch my JAXWS libraries by JAXWS-RI libraries.

          Then on Tomcat I had to add the "endorsed" directory to the Tomcat home directory and place jaxws-api.jar (from JAXWS-RI) in there otherwise it conflicted with Tomcats own classes.

           

          Hopefully someone else will find this useful in the future!