4 Replies Latest reply: Dec 7, 2011 5:08 AM by Niels Morville RSS

    How to enable schema validation with JBoss 7

    Niels Morville Newbie

      The web service I'm developing is working fine, except that I cannot figure out how to activate schema validation. I have several colleagues that have given up on this in other projects. But surely there must be a way. In the apache-cxf-2.4.4 binary I can see that wsdl_first_soap12 does schema validation fine - and it doesn't resort to writing handlers or interceptors or XML-configuration (as far as I can see) - but how that works is a mystery to me.

       

      When I start JBoss I see:

       

      [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-1) Add Service

      id=LuliPortTypeImpl

      address=http://localhost:8080/gflk-hunt-ws/LuliService/LuliPortType

      implementor=com.visma.gflk.hunting.recreational.ws.LuliPortTypeImpl

      invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker

      serviceName={urn:luli:wsdl:v1}LuliService

      portName={urn:luli:wsdl:v1}LuliPort

      wsdlLocation=null

       

      which looks fine (except for wsdlLocation=null). But then it continues with:

       

      [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-1) register: jboss.ws:context=gflk-hunt-ws,endpoint=LuliPortTypeImpl

      [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-1) Creating Service urn:luli:wsdl:v1}LuliService from WSDL: /META-INF/wsdl/luli.wsdl

      WARN  [org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver] (MSC service thread 1-1) Cannot resolve resource: cxf

       

      The second line looks like it finds the WSDL file all right; but I'm worried about the warning.

       

      The annotations I use are the following:

      @Stateless

      @MTOM

      @WebService(

              wsdlLocation = "/META-INF/wsdl/luli.wsdl",

              portName="LuliPort",

              name = "LuliPortType",

              serviceName="LuliService", targetNamespace="urn:luli:wsdl:v1",

              endpointInterface = "luli.wsdl.v1.LuliPortType")

      @javax.xml.ws.BindingType(value =

      "http://www.w3.org/2003/05/soap/bindings/HTTP/")

      @org.apache.cxf.annotations.SchemaValidation(enabled = true)

       

      Does anybody have a suggestion?