-
1. Re: Multiple bindings not supported
thomas.diesler Aug 24, 2005 3:41 AM (in response to christy)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 Sep 12, 2005 9:39 AM (in response to christy)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 Sep 15, 2005 6:14 AM (in response to christy)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 Sep 20, 2005 10:47 AM (in response to christy)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.