Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2516

Schema resolution when Schemas in Jar separate from endpoint implementation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.3
    • 2.1.8, 2.2.5
    • JAX-WS Runtime
    • None

    Description

      I'm going to attach a project which will demonstrate the problem.

      Essentially I have a Web Service Implementation in a WebService module. I have separated out the schemas and wsdls into a module called WebServiceSchemasAndWSDL. The SchemasAndWSDL project is a dependency of the WebService project. If I turn on xsd-validation for my endpoint, when validation runs it will complain that it can't find certain schemas, for example:

      <pre>
      org.apache.cxf.wsdl.EndpointReferenceUtils$SchemaLSResourceResolver
      resolveResource
      WARNING: Could not resolve Schema for COCT_MT090102CA.xsd
      </pre>

      COCT_MT090102CA.xsd is not referenced directly from the WSDL, it's actually referenced from one of the schemas the WSDL references.

      STRUCTURE OF THE PROJECTS:
      WebService Project:
      src/main/java/my/pack/WebServiceImpl.java
      /src/main/resources/config/spring/endpointBeans.xml

      WSDLandSchemas Project:
      src/main/generated/... <-- all the JAXB generated resources from the Schemas/WSDL including the service interface being implemented in the WebService project
      src/main/resources/wsdl/WebService.wsdl
      src/main/resources/telus/Schemas
      src/main/resources/telus/schemas/coreschemas

      So COCT_MT090102CA.xsd exists in the 3rdParty directory (i.e. telus/Schemas) within the WSDLandSchemas project (which is on the classpath for the WebService project). The WSDL references a schema in that same directory and it's that schema which has an <xsd:include schemaLocation="COCT_MT090102CA.xsd"/>

      I'll attach the schema validation errors which occure, as well as the sample project.

      My original problem centered around the fact that if I separated out the wsdl from the schemas (i.e. put the wsdl directly into the WebService project, and ran cxf-codegen-plugin from there) it could never figure out the refereces that the schemas in telus/Schemas had to xsds in telus/schemas/coreschemas. But one problem at a time I suppose.

      Attachments

        1. CXFSchemaProblem.zip
          757 kB
          Craig Tataryn
        2. out.txt
          55 kB
          Craig Tataryn

        Activity

          People

            dkulp Daniel Kulp
            ctataryn Craig Tataryn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: