jax-ws
  1. jax-ws
  2. JAX_WS-777

Schema validation fails when including several schemas with same targetNamespace in the wsdl

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.7
    • Fix Version/s: 2.2.1
    • Component/s: runtime
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      777

      Description

      Hello,

      I am using a pre-defined wsdl. In this wsdl I am including (xs:include) several
      schemas all having the same targetNamespace.

      However all but one of these schemas are unknown for the validator. Respectively
      I get "Cannot find the declaration of element ..." exceptions, although these
      elements are correctly defined in the schema.

      This seems to be a bug in the ServerSchemaValidationTube. If in the source-Array
      returned by getSchemaSources() the source for the wsdl-schemaFragment isn't
      contained at index 0, then exactly this problem occurs. Only the schema at index
      0 is then later known for the validator. There is also a comment hinting at this
      behaviour...

      Attached you find a modified ServerSchemaValidationTube, where the
      wsdl-schemaFragmentSource will always be contained at index 0.

        Activity

        Hide
        jitu added a comment -

        Marking it as enhancement. Will create a pseudo schema with the individual
        wsdl-schema-fragements as imports etc and feed that to Validator.

        Show
        jitu added a comment - Marking it as enhancement. Will create a pseudo schema with the individual wsdl-schema-fragements as imports etc and feed that to Validator.
        Hide
        scm_issue_link added a comment -

        Code changed in jax-ws-sources
        User: jitu
        Path:
        /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/client/ClientSchemaValidationTube.java (1.5.2.4)
        /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/server/ServerSchemaValidationTube.java (1.5.2.6)
        /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/util/pipe/AbstractSchemaValidationTube.java (1.5.2.5)
        http://fisheye5.cenqua.com/changelog/jax-ws-sources/?cs=jaxws22:jitu:20100323005007

        Log:
        [JAX-WS-777]
        If multiple schemas with the same targetnamespace, it should work with
        xerces 2.7 onwards(seems to be working with JDK6 by default). Runtime
        creates a pseudo schema with all the wsdl-inlined schema fragments.
        Issue number:
        Obtained from:
        Submitted by:
        Reviewed by:

        Show
        scm_issue_link added a comment - Code changed in jax-ws-sources User: jitu Path: /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/client/ClientSchemaValidationTube.java (1.5.2.4) /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/server/ServerSchemaValidationTube.java (1.5.2.6) /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/util/pipe/AbstractSchemaValidationTube.java (1.5.2.5) http://fisheye5.cenqua.com/changelog/jax-ws-sources/?cs=jaxws22:jitu:20100323005007 Log: [JAX-WS-777] If multiple schemas with the same targetnamespace, it should work with xerces 2.7 onwards(seems to be working with JDK6 by default). Runtime creates a pseudo schema with all the wsdl-inlined schema fragments. Issue number: Obtained from: Submitted by: Reviewed by:
        Hide
        jitu added a comment -

        Marking it as fixed. In some cases, an application needs to use > xerces2.7 lib
        or JDK6

        Show
        jitu added a comment - Marking it as fixed. In some cases, an application needs to use > xerces2.7 lib or JDK6
        Hide
        scm_issue_link added a comment -

        Code changed in jax-ws-sources
        User: jitu
        Path:
        /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/util/pipe/AbstractSchemaValidationTube.java (1.5.2.6)
        http://fisheye5.cenqua.com/changelog/jax-ws-sources/?cs=jaxws22:jitu:20100327013732

        Log:
        [JAX-WS-777] Creating one schema using the following algo(from the xerces
        discussing thread):
        "If you're synthesizing schema documents to glue together the ones in
        the WSDL then you may not even need to use "honour-all-schemaLocations".
        Create a schema document for each namespace with <xs:include>s
        (for each schema document in the WSDL with that target namespace)
        and then combine those together with <xs:import>s for each of those
        namespaces in a "master" schema document. That should work with any
        schema processor, not just those which honour multiple imports for
        the same namespace."

        Issue number:
        Obtained from:
        Submitted by:
        Reviewed by:

        Show
        scm_issue_link added a comment - Code changed in jax-ws-sources User: jitu Path: /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/util/pipe/AbstractSchemaValidationTube.java (1.5.2.6) http://fisheye5.cenqua.com/changelog/jax-ws-sources/?cs=jaxws22:jitu:20100327013732 Log: [JAX-WS-777] Creating one schema using the following algo(from the xerces discussing thread): "If you're synthesizing schema documents to glue together the ones in the WSDL then you may not even need to use "honour-all-schemaLocations". Create a schema document for each namespace with <xs:include>s (for each schema document in the WSDL with that target namespace) and then combine those together with <xs:import>s for each of those namespaces in a "master" schema document. That should work with any schema processor, not just those which honour multiple imports for the same namespace." Issue number: Obtained from: Submitted by: Reviewed by:
        Hide
        scm_issue_link added a comment -

        Code changed in jax-ws-sources
        User: jitu
        Path:
        /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/util/pipe/AbstractSchemaValidationTube.java (1.5.2.7)
        http://fisheye5.cenqua.com/changelog/jax-ws-sources/?cs=jaxws22:jitu:20100330232814

        Log:
        [JAX-WS-777] When consolidating the schemas for a namespace, even external
        schemas also need to be included.
        Issue number:
        Obtained from:
        Submitted by:
        Reviewed by:

        Show
        scm_issue_link added a comment - Code changed in jax-ws-sources User: jitu Path: /jax-ws-sources/jaxws-ri/rt/src/com/sun/xml/ws/util/pipe/AbstractSchemaValidationTube.java (1.5.2.7) http://fisheye5.cenqua.com/changelog/jax-ws-sources/?cs=jaxws22:jitu:20100330232814 Log: [JAX-WS-777] When consolidating the schemas for a namespace, even external schemas also need to be included. Issue number: Obtained from: Submitted by: Reviewed by:

          People

          • Assignee:
            jitu
            Reporter:
            paschme
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: