3 Replies Latest reply on Mar 5, 2006 12:10 PM by thomas.diesler

    one ejb, multiple webservice types

    dhartford

      Hey all,
      Trying to deploy a single bean with multiple webservices:
      RPC/Encoded
      RPC/Literal
      Document/Literal


      Everything looks good until the end:

      15:50:51,517 INFO [EjbModule] Deploying BasicTypesBean
      15:50:51,564 INFO [EJBDeployer] Deployed: file:/C:/jboss/jboss-4.0.2RC1/server/all/deploy/BasicTypesService.jar
      15:50:51,595 INFO [WSDLFilePublisher] WSDL published to: file:/C:/jboss/jboss-4.0.2RC1/server/all/data/wsdl/BasicTypesS
      ervice.jar/RpcEncService.wsdl
      15:50:51,611 INFO [WSDLFilePublisher] WSDL published to: file:/C:/jboss/jboss-4.0.2RC1/server/all/data/wsdl/BasicTypesS
      ervice.jar/RpcLitService.wsdl
      15:50:51,611 INFO [WSDLFilePublisher] WSDL published to: file:/C:/jboss/jboss-4.0.2RC1/server/all/data/wsdl/BasicTypesS
      ervice.jar/DocLitService.wsdl
      15:50:51,674 INFO [AxisService] WSDD published to: C:\jboss\jboss-4.0.2RC1\server\all\data\wsdl\BasicTypesService.jar\R
      pcEncBasicTypesEndpointPort.wsdd
      15:50:51,674 INFO [AxisService] Web Service deployed: http://MYSERVER:8080/BasicTypesService/RpcEncBasicTypesEndpoint
      Port
      15:50:51,720 INFO [AxisService] WSDD published to: C:\jboss\jboss-4.0.2RC1\server\all\data\wsdl\BasicTypesService.jar\R
      pcLitBasicTypesEndpointPort.wsdd
      15:50:51,720 INFO [AxisService] Web Service deployed: http://MYSERVER:8080/BasicTypesService/RpcLitBasicTypesEndpoint
      Port
      15:50:51,767 INFO [AxisService] WSDD published to: C:\jboss\jboss-4.0.2RC1\server\all\data\wsdl\BasicTypesService.jar\D
      ocLitBasicTypesEndpointPort.wsdd
      15:50:51,767 INFO [AxisService] Web Service deployed: http://MYSERVER:8080/BasicTypesService/DocLitBasicTypesEndpoint
      Port
      15:50:51,767 ERROR [ServiceDeployer] Cannot startup webservice for: BasicTypesService.jar
      java.lang.IllegalArgumentException: Cannot use the same url-pattern with different endpoints, check your <port-component
      -uri> in jboss.xml
       at org.jboss.webservice.ServiceDeployerEJB.createWebXML(ServiceDeployerEJB.java:221)
       at org.jboss.webservice.ServiceDeployerEJB.deployWebservices(ServiceDeployerEJB.java:105)
       at org.jboss.webservice.ServiceDeployer.startWebservice(ServiceDeployer.java:233)
       at org.jboss.webservice.ServiceDeployer.handleNotification(ServiceDeployer.java:112)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:138)
       at $Proxy25.handleNotification(Unknown Source)
      


      DocLitService.wsdl:
      ...
       <service name="DocLitService">
       <port name="DocLitBasicTypesEndpointPort" binding="tns:BasicTypesEndpointBinding">
       <soap:address location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>
      


      RpcEncService.wsdl:
      ...
       <service name="RpcEncService">
       <port name="RpcEncBasicTypesEndpointPort" binding="tns:BasicTypesEndpointBinding">
       <soap:address location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>
      


      RpcLitService.wsdl:
      ...
       <service name="RpcLitService">
       <port name="RpcLitBasicTypesEndpointPort" binding="tns:BasicTypesEndpointBinding">
       <soap:address location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>
      


      webservices.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <webservices
       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_web_services_1_1.xsd"
       version="1.1">
       <webservice-description>
       <icon>
       </icon>
       <webservice-description-name>RpcEncService</webservice-description-name>
       <wsdl-file>META-INF/wsdl/RpcEncService.wsdl</wsdl-file>
       <jaxrpc-mapping-file>META-INF/rpcencmappings.xml</jaxrpc-mapping-file>
       <port-component>
       <icon>
       </icon>
       <port-component-name>RpcEncBasicTypesEndpointPort</port-component-name>
       <wsdl-port>RpcEncBasicTypesEndpointPort</wsdl-port>
       <service-endpoint-interface>com.binarymonk.wstest.interfaces.BasicTypesEndpoint</service-endpoint-interface>
       <service-impl-bean>
       <ejb-link>BasicTypesBean</ejb-link>
       </service-impl-bean>
       </port-component>
       </webservice-description>
       <webservice-description>
       <icon>
       </icon>
       <webservice-description-name>RpcLitService</webservice-description-name>
       <wsdl-file>META-INF/wsdl/RpcLitService.wsdl</wsdl-file>
       <jaxrpc-mapping-file>META-INF/rpclitmappings.xml</jaxrpc-mapping-file>
       <port-component>
       <icon>
       </icon>
       <port-component-name>RpcLitBasicTypesEndpointPort</port-component-name>
       <wsdl-port>RpcLitBasicTypesEndpointPort</wsdl-port>
       <service-endpoint-interface>com.binarymonk.wstest.interfaces.BasicTypesEndpoint</service-endpoint-interface>
       <service-impl-bean>
       <ejb-link>BasicTypesBean</ejb-link>
       </service-impl-bean>
       </port-component>
       </webservice-description>
       <webservice-description>
       <icon>
       </icon>
       <webservice-description-name>DocLitService</webservice-description-name>
       <wsdl-file>META-INF/wsdl/DocLitService.wsdl</wsdl-file>
       <jaxrpc-mapping-file>META-INF/doclitmappings.xml</jaxrpc-mapping-file>
       <port-component>
       <icon>
       </icon>
       <port-component-name>DocLitBasicTypesEndpointPort</port-component-name>
       <wsdl-port>DocLitBasicTypesEndpointPort</wsdl-port>
       <service-endpoint-interface>com.binarymonk.wstest.interfaces.BasicTypesEndpoint</service-endpoint-interface>
       <service-impl-bean>
       <ejb-link>BasicTypesBean</ejb-link>
       </service-impl-bean>
       </port-component>
       </webservice-description>
      </webservices>
      


      All WSDL and mapping files were generated by WSCOMPILE, and there is a seperate mapping file for each WDSL (not attached as not the problem).

      Is it possible to have one EJB Bean, generate one EJBEndpoint, then have multiple WSDL and Mapping files for this single EJBEndpoint?


      thanky,
      -D

        • 1. Re: one ejb, multiple webservice types
          thomas.diesler

          Yes, but you need to setup individual URLs - one for each endpoint.


          Cannot use the same url-pattern with different endpoints, check your <port-component-uri> in jboss.xml



          • 2. Re: one ejb, multiple webservice types
            damian_morris

            Thomas,

            I'm having the same problem. I'm trying to use a single SLSB as a single endpoint for two web services. I've added two port-component elements to my SLSB's session element, in jboss.xml:

            <session>
             <ejb-name>UserSessionWS</ejb-name>
             <configuration-name>
             Standard Stateless SessionBean
             </configuration-name>
             <port-component>
             <port-component-name>
             StatelessSession
             </port-component-name>
             <port-component-uri>
             AllServices
             </port-component-uri>
             </port-component>
             <port-component>
             <port-component-name>
             PropertyWebService
             </port-component-name>
             <port-component-uri>
             PropertyService
             </port-component-uri>
             </port-component>
            </session>
            



            but JBoss 4.0.3 SP1 is ignoring the second port-component element:

            [main] [AxisService] WSDD published to: /usr/local/java/j2ee/jboss/jboss-4.0.3SP1/server/default/data/wsdl/gateway.ear/gateway.jar/PropertyWebService.wsdd
            [main] [AxisService] Web Service deployed: http://localhost:8080/ws/AllServices
            
            [main] [AxisService] WSDD published to: /usr/local/java/j2ee/jboss/jboss-4.0.3SP1/server/default/data/wsdl/gateway.ear/gateway.jar/StatelessSession.wsdd
            [main] [AxisService] Web Service deployed: http://localhost:8080/ws/AllServices
            
            [main] [ServiceDeployer] Cannot startup webservice for: gateway.jar
            java.lang.IllegalArgumentException: Cannot use the same url-pattern with different endpoints, check your <port-component-uri> in jboss.xml
            



            This seems to be confirmed by org.jboss.webservice.ServiceDeployerEJB.createWebXML(), where the port component is retrieved based on the ejb-link tag - which is obviously the same for both web-services - and so only the first port-component can ever be used.

            However, the jboss.xml DTD specifies that zero or more port-component elements are permissible, and so does your post. Any help would be much appreciated.

            Thanks very much,

            Damian

            • 3. Re: one ejb, multiple webservice types
              thomas.diesler

               

              <!-- Relative path that is appended to the <context-root> element to form fully qualified
              endpoint address for a web service endpoint.
              
              For backwards compatibility, it may also be the absolute path starting with web context root
              to form fully qualified endpoint address for a web service endpoint. In this case, the port component uri
              must contain at least two token seperated by '/'. The first token is the web context root,
              which must be identical among all port component uris in a given deployment.
              
              Used in: port-component
              -->
              <!ELEMENT port-component-uri (#PCDATA) >
              


              Have a look at

              http://jira.jboss.com/jira/browse/JBWS-165