Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-162

The XsdBasedSoap11Wsdl4jDefinitionBuilder does not support multiple xsds in generating a WSDL file.

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.2
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows XP/JDK 1.5.0_11-b03/Tomcat 6.0/ Maven 2.0.7

      Description

      This is bug that needs to be fixed in XsdBasedSoap11Wsdl4jDefinitionBuilder according to Arjen Poutsma. The workaround is to expose all xsd files. This bug needs to be fixed so that we can design and build modular web services.

      There is a detail description about this issue on Spring Web Service Forum. The thread is created on "How spring is handling multiple xsds in generating a WSDL file"?

        Issue Links

          Activity

          Show
          arjen.poutsma Arjen Poutsma added a comment - See http://forum.springframework.org/showthread.php?t=42130
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          The XsdBasedSoap11Wsdl4jDefinitionBuilder now has a property "schemaLocation". Setting this property will make the builder use an xsd:import rather than inline the schema. The imported schema can then refer to other imported schemas by using additional xsd:imports.

          Show
          arjen.poutsma Arjen Poutsma added a comment - The XsdBasedSoap11Wsdl4jDefinitionBuilder now has a property "schemaLocation". Setting this property will make the builder use an xsd:import rather than inline the schema. The imported schema can then refer to other imported schemas by using additional xsd:imports.
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          The resolution for SWS-162 is currently rather limited. It does not process the request and response elements in imported files, it only allows you to refer to elements found in imported files. We should descend into imported files, and process them completely.

          Show
          arjen.poutsma Arjen Poutsma added a comment - The resolution for SWS-162 is currently rather limited. It does not process the request and response elements in imported files, it only allows you to refer to elements found in imported files. We should descend into imported files, and process them completely.
          Hide
          bkalali Bahman Kalali added a comment -

          Hi Arjen,

          I have encountered another problem when I started using this feature and I am not sure if this issue is related to the one that you have resolved it.

          I set the second schema (commonTypes.xsd) in the shemaLocation and redeployed our app. The commonTypes.xsd is imported onto WSDL file which has schema definition for request and response (LoanHistoryReqRes.xsd). These settings are shown as follows:

          <bean id="loanHistoryWsdl" class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition">
          <property name="builder">
          <bean class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder">
          <property name="schema" value="classpath:LoanHistoryReqRes.xsd" />
          <property name="schemaLocation" value="CommonTypes.xsd" />
          <property name="portTypeName" value="LHISWebService" />
          <!-- This probably eventually needs to https -->
          <property name="locationUri" value="http://$

          {webService.host}

          /LHService/services" />
          <property name="prefix" value="tns" />
          <property name="schemaPrefix" value="lhis" />
          <property name="targetNamespace" value="http://www.countrywide.com/LoanHistory/definitions" />
          </bean>
          </property>
          </bean>

          When I imported the WSDL file (from URL), which has a reference to
          commonType.xsd, to SOAP UI, I got a SAX exception in parsing WSDL.
          However, when I saved both WSDL and commonTypes.xsd in one folder and
          import the WSDL to SOAP UI, then everything works fine.

          Is this issue the same as the one you have resolved it?

          BR//Bahman

          Show
          bkalali Bahman Kalali added a comment - Hi Arjen, I have encountered another problem when I started using this feature and I am not sure if this issue is related to the one that you have resolved it. I set the second schema (commonTypes.xsd) in the shemaLocation and redeployed our app. The commonTypes.xsd is imported onto WSDL file which has schema definition for request and response (LoanHistoryReqRes.xsd). These settings are shown as follows: <bean id="loanHistoryWsdl" class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition"> <property name="builder"> <bean class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder"> <property name="schema" value="classpath:LoanHistoryReqRes.xsd" /> <property name="schemaLocation" value="CommonTypes.xsd" /> <property name="portTypeName" value="LHISWebService" /> <!-- This probably eventually needs to https --> <property name="locationUri" value="http://$ {webService.host} /LHService/services" /> <property name="prefix" value="tns" /> <property name="schemaPrefix" value="lhis" /> <property name="targetNamespace" value="http://www.countrywide.com/LoanHistory/definitions" /> </bean> </property> </bean> When I imported the WSDL file (from URL), which has a reference to commonType.xsd, to SOAP UI, I got a SAX exception in parsing WSDL. However, when I saved both WSDL and commonTypes.xsd in one folder and import the WSDL to SOAP UI, then everything works fine. Is this issue the same as the one you have resolved it? BR//Bahman
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          No, this is a different issue. You can probably resolve your problem by making the schemaLocation point to the location where LoanHistoryReqRes.xsd is exposed.

          Show
          arjen.poutsma Arjen Poutsma added a comment - No, this is a different issue. You can probably resolve your problem by making the schemaLocation point to the location where LoanHistoryReqRes.xsd is exposed.
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          The XsdBasedSoap11Wsdl4jDefinitionBuilder now has a 'followIncludeImport' property, which you can set to true to follow schema imports and includes. Note that the referenced schemas must be readable to clients, i.e. exposed as resource.

          Show
          arjen.poutsma Arjen Poutsma added a comment - The XsdBasedSoap11Wsdl4jDefinitionBuilder now has a 'followIncludeImport' property, which you can set to true to follow schema imports and includes. Note that the referenced schemas must be readable to clients, i.e. exposed as resource.
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Closing 1.0.2 issues.

          Show
          arjen.poutsma Arjen Poutsma added a comment - Closing 1.0.2 issues.

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              bkalali Bahman Kalali
            • Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: