3 Replies Latest reply on Feb 25, 2005 3:58 AM by Thomas Diesler

    Error: Multiple bindings for not supported for service

    Matthew Robinson Newbie

      Hello.

      I am trying to implement a J2EE Web Service Client in a Session Bean. My JBOSS version is 4.0.1. I get this message when the Bean attempts to make it's first call:

      2005-02-24 16:58:19,612 INFO [STDOUT] {http://www.w3.org/2001/XMLSchema}schema already exists
      2005-02-24 16:58:19,613 INFO [STDOUT] {http://www.w3.org/2001/XMLSchema}schema already exists
      2005-02-24 16:58:19,615 INFO [STDOUT] {http://www.w3.org/2001/XMLSchema}schema already exists
      2005-02-24 16:58:19,779 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException in method: public abstract java.lang.String xxx.datastore.session.facade.external.Gne.authenticate() throws java.rmi.RemoteException, causedBy:
      javax.naming.NamingException: Could not dereference object [Root exception is java.lang.IllegalArgumentException: Multiple bindings for not supported for service: {http://xxx.xxxxx.net/}Search]
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:658)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
       at javax.naming.InitialContext.lookup(InitialContext.java:347)
       at flightcentre.datastore.session.facade.external.GneBean.authenticate(GneBean.java:61)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      .
      .
      .
      


      I am using the J2EE 'service-reference' method to look up the required service in JNDI - ejb-jar excerpt follows:
      <ejb-name>Gne</ejb-name>
      
      <home>xxx.datastore.session.facade.external.GneHome</home>
      <remote>xxx.datastore.session.facade.external.Gne</remote>
      <local-home>xxx.datastore.session.facade.external.GneLocalHome</local-home>
      <local>xxx.datastore.session.facade.external.GneLocal</local>
      <ejb-class>xxx.datastore.session.facade.external.GneSession</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <service-ref>
       <service-ref-name>services/gne</service-ref-name>
       <service-interface>javax.xml.rpc.Service</service-interface>
       <wsdl-file>META-INF/wsdl/gne.wsdl</wsdl-file>
      </service-ref>
      


      I have no idea even where to start with this. The WSDL (gne.wsdl) describes a webservice on a .NET server and seems highly complex. There are multiple namespaces.

      In the interests of brevity, I have not included all the code, but will if someone asks for it.

      Kind Regards,

        • 1. Re: Error: Multiple bindings for not supported for service
          Thomas Diesler Master

          Your wsdl service might define multiple ports. In your <service-ref> you should specify which one you want - they will probably have different endpoint addresses as well.

          • 2. Re: Error: Multiple bindings for not supported for service
            Matthew Robinson Newbie

            Thanks Thomas.

            It seems to define one service with multiple ports, which in turn are associated with port types. See below (I have cut the detail to show the declarations):

            <wsdl:portType name="SearchSoap">
             <wsdl:operation name="Authenticate">
             <wsdl:operation name="Search">
             <wsdl:operation name="GetContractGrids">
             <wsdl:operation name="SearchByFareCode">
             <wsdl:operation name="WindowBoardSearch">
             <wsdl:operation name="GNESearch">
            </wsdl:portType>
            <wsdl:portType name="SearchHttpPost">
             <wsdl:operation name="Authenticate">
             <wsdl:operation name="Search">
            </wsdl:portType>
            <wsdl:binding name="SearchSoap" type="tns:SearchSoap">
            <wsdl:binding name="SearchHttpPost" type="tns:SearchHttpPost">
            <wsdl:service name="Search">
             <wsdl:port name="SearchSoap" binding="tns:SearchSoap">
             <wsdl:port name="SearchHttpPost" binding="tns:SearchHttpPost">
            </wsdl:service>
            

            I tried putting this into the ejb-jar.xml file:
            <service-qname>SearchSoap</service-qname>
            

            Got a new error:
            2005-02-25 12:41:19,842 DEBUG [com.ibm.wsdl.xml.WSDLReaderImpl] Retrieving document at 'jar:file:/home/jboss/server/fcau/tmp/deploy/tmp30301ExternalAccess.jar!/META-INF/wsdl/gne.wsdl'.
            2005-02-25 12:41:19,856 DEBUG [org.jboss.webservice.EngineConfigurationFinder] Found config at: file:/home/jboss/server/fcau/deploy/jboss-ws4ee.sar/META-INF/axis-client-config.xml
            2005-02-25 12:41:19,878 INFO [STDOUT] {http://www.w3.org/2001/XMLSchema}schema already exists
            2005-02-25 12:41:19,880 INFO [STDOUT] {http://www.w3.org/2001/XMLSchema}schema already exists
            2005-02-25 12:41:19,882 INFO [STDOUT] {http://www.w3.org/2001/XMLSchema}schema already exists
            2005-02-25 12:41:20,013 ERROR [org.apache.axis.client.Service] Error processing WSDL document:
            javax.xml.rpc.ServiceException: Cannot find service: SearchSoap
            javax.xml.rpc.ServiceException: Error processing WSDL document:
            javax.xml.rpc.ServiceException: Cannot find service: SearchSoap
             at org.apache.axis.client.Service.initService(Service.java:352)
             at org.apache.axis.client.Service.initService(Service.java:282)
             at org.apache.axis.client.Service.<init>(Service.java:189)
            

            Would really appreciate some more help, thanks Thomas.

            Kind Regards,

            • 3. Re: Error: Multiple bindings for not supported for service
              Thomas Diesler Master

              You need to use a <port-component-ref> element

              j2ee_web_services_client_1_1.xsd

               <xsd:element name="port-component-ref"
               type="j2ee:port-component-refType"
               minOccurs="0" maxOccurs="unbounded">
               <xsd:annotation>
               <xsd:documentation>
              
               The port-component-ref element declares a client dependency
               on the container for resolving a Service Endpoint Interface
               to a WSDL port. It optionally associates the Service Endpoint
               Interface with a particular port-component. This is only used
               by the container for a Service.getPort(Class) method call.
              
               </xsd:documentation>
               </xsd:annotation>
               </xsd:element>