private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions wsdlDefinitions) throws IOException
{
QName serviceName = serviceMetaData.getServiceName();
// Get the WSDL service
WSDLService wsdlService = null;
if (serviceName == null)
{
if (wsdlDefinitions.getServices().length != 1)
throw new IllegalArgumentException("Expected a single service element");
wsdlService = wsdlDefinitions.getServices()[0];
serviceMetaData.setServiceName(wsdlService.getName());
}
else
{
wsdlService = wsdlDefinitions.getService(serviceName);
}
if (wsdlService == null)
{
List<QName> serviceNames = new ArrayList<QName>();
for (WSDLService wsdls : wsdlDefinitions.getServices())
serviceNames.add(wsdls.getName());
throw new IllegalArgumentException("Cannot obtain wsdl service: " + serviceName + " we have " + serviceNames);
}
// Build endpoint meta data
for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
{
QName bindingName = wsdlEndpoint.getBinding();
WSDLBinding wsdlBinding = wsdlEndpoint.getWsdlService().getWsdlDefinitions().getBinding(bindingName);
String bindingType = wsdlBinding.getType();
if (Constants.NS_SOAP11.equals(bindingType) || Constants.NS_SOAP12.equals(bindingType))