3 Replies Latest reply on Feb 25, 2005 3:47 AM by thomas.diesler

    Multiple bindings not supported for service

    raja05

      Hello
      I have a WSDL File which looks like
      Snippet from WSDL:

      <service name="RajaTest">
       <port name="TestBeanEndPointPort" binding="tns:TestBeanEndPointBinding">
       <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
       </port>
       <port name="CEEBeanEndPointPort" binding="tns:CEEBeanEndPointBinding">
       <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
       </port>
      </service>
      

      This has been generated using the JWSDP wscompile tool for 2 ports in a single service. So this has 2 ports defined with my single service. It deploys fine but when i invoke my client like
       QName testQName = new QName("http://xxx.net", "RajaTest");
       QName ceeQName = new QName("http://xxx.net", "RajaTest");
       ServiceFactory fact = ServiceFactory.newInstance();
       testService = fact.createService(testURL, testQName);
       ceeService = fact.createService(ceeURL, testQName);
      

      the client code bombs out with a
      java.lang.IllegalArgumentException: Multiple bindings for not supported for service: {http://xxx.net}RajaTest
      javax.xml.rpc.ServiceException: java.lang.IllegalArgumentException: Multiple bindings for not supported for service: {http://collab.net}RajaTest
      at org.jboss.webservice.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:125)
      at com.clientapp.TestClient.setUp(TestClient.java:29)

      Tracing back to the source,
       Iterator it = wsdlService.getPorts().values().iterator();
       while (it.hasNext())
       {
       Port port = (Port)it.next();
       Binding binding = port.getBinding();
      
       if (wsdlBinding != null && wsdlBinding.getQName().equals(binding.getQName()) == false)
       throw new IllegalArgumentException("Multiple bindings for not supported for service: " + wsdlService.getQName());
      
       if (wsdlBinding == null)
       wsdlBinding = binding;
       }
       }
      

      It looks like this code will bomb for every service that can have multiple ports. If i have 2 ports that differ only in the type of transport, then both of them have the same QName and it looks like the code will error for such a case. In my case, i have a default namespace of http://xxx.com and i have the same namespace applied for both the ports.

      Is this a bug? Why should the ports within a service be restricted?



        • 1. Re: Multiple bindings not supported for service
          raja05

          In other words, should there only be a 1:1 ration between the Service and the ports?
          According to the WSDL Documentation, it looks like there could be multiple ports per service but can i have 2 different endpoints that relate to different webservices in a single "service" element?

          • 2. Re: Multiple bindings not supported for service
            jurrien

            I have the same problem if I use the JBOSS implementation in my Java clients
            System.setProperty(ServiceFactory.SERVICEFACTORY_PROPERTY,"org.jboss.webservice.client.ServiceFactoryImpl");

            When I use the SUN jwsdp-1.5 jars in my client and use the default ServiceFactory.SERVICEFACTORY_PROPERTY all works fine.

            So I'm thinking this is a JBOSS bug...

            I'm using 4.0.0

            • 3. Re: Multiple bindings not supported for service
              thomas.diesler

              The JAXRPC DII API is not designed with WS4EE in mind. You will also have the problem of your DII client not beeing jaxrpc-mapping.xml aware.

              There is a wiki on DII
              http://www.jboss.org/wiki/Wiki.jsp?page=WSClientDII

              It all boils down to using

               /**
               * Create a <code>Service</code> instance.
               * <p/>
               * Note, this method is not in the {@link ServiceFactory} interface, it provides the service
               * with additional ws4ee wsdl/java mapping information
               *
               * @param wsdlLocation URL for the WSDL document location
               * @param mappingLocation An optional URL for the jaxrpc-mapping.xml location
               * @param serviceName QName for the service.
               * @param portName An optional port name
               * @return Service.
               * @throws ServiceException If any error in creation of the
               * specified service
               */
               public Service createService(URL wsdlLocation, URL mappingLocation, URL ws4eeMetaData, QName serviceName, String portName) throws ServiceException