4 Replies Latest reply on Sep 20, 2005 10:47 AM by Thomas Diesler

    Multiple bindings not supported

    Christy Christy Novice

      Hi,
      I decided to connect to the remote web service (I found it in IBM Registry). I used DII client, but I have an error:

      javax.xml.rpc.ServiceException: java.lang.IllegalArgumentException: Multiple bindings not supported for service: {http://www.neonsys.com/WebServices/CICS}CICS
      at org.jboss.webservice.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:124)
      at RemoteClient.main(RemoteClient.java:19)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
      Caused by: java.lang.IllegalArgumentException: Multiple bindings not supported for service: {http://www.neonsys.com/WebServices/CICS}CICS
      at org.jboss.webservice.deployment.ServiceDescription.getWsdlBinding(ServiceDescription.java:1027)
      at org.jboss.webservice.deployment.ServiceDescription.(ServiceDescription.java:104)
      at org.jboss.webservice.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:119)

      Does anybody know what is this?
      Thank you!

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

          Try explicitly naming the port.

           /**
           * Get the wsdl binding with for the given service and portName
           * If portName is null, it iterates over the available bindings and checks that their are not multiple
           * definitions.
           */
           private Binding getWsdlBinding(Service wsdlService, String portName)
           {
           Binding wsdlBinding = null;
          
           if (portName != null)
           {
           Port port = wsdlService.getPort(portName);
           if (port == null)
           throw new IllegalArgumentException("Cannot find wsdl port for: " + portName);
          
           wsdlBinding = port.getBinding();
           }
           else
           {
           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 not supported for service: " + wsdlService.getQName());
          
           if (wsdlBinding == null)
           wsdlBinding = binding;
           }
           }
          
           if (wsdlBinding == null)
           throw new IllegalArgumentException("Cannot find wsdl binding for: " + wsdlService.getQName());
          
           return wsdlBinding;
           }
          


          • 2. Re: Multiple bindings not supported
            Christy Christy Novice

            Thomas, can you please explain where this method is located?
            Here is my code:
            import javax.xml.namespace.QName;
            import javax.xml.rpc.Call;
            import javax.xml.rpc.ServiceFactory;
            import java.net.URL;

            public class RemoteClient {
            public static void main(String[] args) {
            String nmsp = "http://www.neonsys.com/WebServices/CICS";//targetNamespace in WSDL
            String qnameService = "CICS";
            String qnamePort = "CICSSoap";//<port name in WSDL
            String urlstr = "http://mkt.neonsys.com/demo/kobsoap?wsdl";
            try {
            URL url = new URL(urlstr);
            ServiceFactory factory = ServiceFactory.newInstance();
            javax.xml.rpc.Service serv = null;
            QName qName = null;
            try {
            qName = new QName(nmsp, qnameService);
            serv = factory.createService(url, qName);
            } catch (Exception ex) {
            System.out.println("qnameService = " + qnameService);
            ex.printStackTrace();
            }

            Call call = serv.createCall(new QName(nmsp, qnamePort), new QName(nmsp, "ShowUser"));
            String resEl = "";
            System.out.println("output before call.invoke:");
            System.out.println("call.getTargetEndpointAddress() = " + call.getTargetEndpointAddress());
            System.out.println("call.getOutputValues().toString() = " + call.getOperationName().toString());
            System.out.println("output:" + call.invoke(new Object[]{}));
            } catch (Exception e) {
            e.printStackTrace();
            }
            }
            }

            What did you mentioned saying "Try explicitly naming the port"?
            Thanks.

            • 3. Re: Multiple bindings not supported
              Christy Christy Novice

              Maybe someone tried to call any remote WS and can help me, because I
              can't understand where is my mistake!

              Thank you

              • 4. Re: Multiple bindings not supported
                Thomas Diesler Master

                Its a code snipit from our implementation

                Caused by: java.lang.IllegalArgumentException: Multiple bindings not supported for service: {http://www.neonsys.com/WebServices/CICS}CICS
                at org.jboss.webservice.deployment.ServiceDescription.getWsdlBinding(ServiceDescription.java:1027)
                


                Is portName really null in ServiceDescription.getWsdlBinding(...) when using Service.createCall(portName, operationName) ?

                If so, could you please create a JIRA issue for it.