2 Replies Latest reply on Dec 14, 2015 9:39 AM by dfilippov

    Schema validation for one-way web service operation

    dfilippov

      Hello!

      I have a JAX-WS web service with one-way operation and I use CXF's @SchemaValidation in order to validate inbound messages against schema specified in WSDL:

      @WebService
      @org.apache.cxf.annotations.SchemaValidation
      public class Foo {
          @WebMethod
          @Oneway
          void bar(Baz baz) {
             ...
         }
      }
      

      Everything works great for regular (synchronous) operation: CXF validates inbound message and responds with SOAP fault if the message doesn't match the schema.

      But for one-way operation (e.g. bar), validation occurs after the server already sent 202 HTTP response and bar isn't called at all in case of validation failure.

      Is there any way to make CXF validate messages before sending 202 response to client? Or is there more correct approach to validate inbound messages for one-way operation?

      Any help would be appreciated!