Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-79

Cannot deploy a ws containing more than one service per wsdl

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jboss-ws4ee-4.0.2
    • jboss-ws4ee-4.0.1
    • jbossws-native
    • None

      JBoss fails to deploy webservices containing multiple <wsdl:service> elements per wsdl file. The following error is produced:

      09:50:38,437 ERROR [ServiceDeployer] Cannot startup webservice for: tbs.war
      java.lang.IllegalArgumentException: Unsupported number of service elements in wsdl document
      at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.replaceAddressLocations(WebserviceDescriptionMetaData.java:240)
      at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.updateServiceAddress(WebserviceDescriptionMetaData.java:229)
      at org.jboss.webservice.ServiceDeployer.startWebservice(ServiceDeployer.java:179)
      ...

      Multiple <wsdl:service> elements per wsdl is a proper construct and is reflected in the xsd's for the webservices.xml and jaxrpc-mapping.xml deployment files as referenced here:

      http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd
      http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd

      org.apache.axis.wsdl.Java2WSDL also supports this construct with its --input argument.

      Sorry I don't have a basic deployable example ready; I wanted to get it reported as soon as possible. However, here are some fragments just for the sake of visualization...

      ANT build fragment:

      <java classname="org.apache.axis.wsdl.Java2WSDL" fork="yes" dir=".">
      <classpath path="${classpath}" />
      <arg value="--location=http://localhost:8080/tbs/services/psr" />
      <arg value="--servicePortName=psr" />
      <arg value="--namespace=urn:tbs" />
      <!-- <arg value="p" /> --> <!- mapping from the package to a namespace. There may be multiple mappings.-->
      <arg value="--output=build/web/WEB-INF/wsdl/tbs.wsdl" />
      <arg value="--use=LITERAL" />
      <arg value="com.ntc.TBS_API.PSR.PSR" />
      </java>
      <java classname="org.apache.axis.wsdl.Java2WSDL" fork="yes" dir=".">
      <classpath path="${classpath}" />
      <arg value="--input=build/web/WEB-INF/wsdl/tbs.wsdl" />
      <arg value="--location=http://localhost:8080/tbs/services/wm" />
      <arg value="--servicePortName=wm" />
      <arg value="--namespace=urn:tbs" />
      <arg value="--output=build/web/WEB-INF/wsdl/tbs.wsdl" />
      <arg value="--use=LITERAL" />
      <arg value="com.ntc.TBS_API.WM.WM" />
      </java>

      webservices.xml:

      <?xml version='1.0' encoding='UTF-8' ?>

      <webservices

      xmlns="http://java.sun.com/xml/ns/j2ee"

      xmlns:impl="http://com.myapp/ws4ee"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee

      http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"

      version="1.1">

      <webservice-description>

      <webservice-description-name>TBSService</webservice-description-name>

      <wsdl-file>WEB-INF/wsdl/tbs.wsdl</wsdl-file>

      <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>

      <port-component>

      <port-component-name>psr</port-component-name>

      <wsdl-port>psr</wsdl-port>

      <service-endpoint-interface>com.ntc.TBS_API.PSR.PSR</service-endpoint-interface>

      <service-impl-bean>

      <servlet-link>PSRServlet</servlet-link>

      </service-impl-bean>

      </port-component>
      <port-component>

      <port-component-name>wm</port-component-name>

      <wsdl-port>wm</wsdl-port>

      <service-endpoint-interface>com.ntc.TBS_API.WM.WM</service-endpoint-interface>

      <service-impl-bean>

      <servlet-link>WMServlet</servlet-link>

      </service-impl-bean>

      </port-component>

      </webservice-description>

      </webservices>

      jaxrpc-mapping.xml:

      <?xml version='1.0' encoding='UTF-8' ?>

      <java-wsdl-mapping

      xmlns="http://java.sun.com/xml/ns/j2ee"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee

      http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd"

      version="1.1">

      <package-mapping>

      <package-type>com.ntc.TBS_API.PSR</package-type>

      <namespaceURI>http://com.myapp/psr</namespaceURI>

      </package-mapping>
      <package-mapping>

      <package-type>com.ntc.app.TBS_API.WM</package-type>

      <namespaceURI>http://com.myapp/wm</namespaceURI>

      </package-mapping>

      </java-wsdl-mapping>

              tdiesler@redhat.com Thomas Diesler
              brittm_jira brittm (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: