Multiple bindings not supported for service
raja05 Jan 21, 2005 4:31 AMHello
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?