wsdlDefinition.setNamespace(model.getNamespace());
WSDLDefinition resolved = null;
try {
resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition);
} catch (ContributionRuntimeException e) {
ContributionResolveException ce = new ContributionResolveException(e.getCause());
error("ContributionResolveException", wsdlDefinition, ce);
//throw ce;
}
if (resolved != null && !resolved.isUnresolved()) {
wsdlDefinition.setDefinition(resolved.getDefinition());
wsdlDefinition.setLocation(resolved.getLocation());
wsdlDefinition.setURI(resolved.getURI());
wsdlDefinition.getImportedDefinitions().addAll(resolved.getImportedDefinitions());
wsdlDefinition.getXmlSchemas().addAll(resolved.getXmlSchemas());
wsdlDefinition.setUnresolved(false);
model.setDefinition(wsdlDefinition);
if (model.getBindingName() != null) {
WSDLObject<Binding> binding = wsdlDefinition.getWSDLObject(Binding.class, model.getBindingName());
if (binding != null) {
wsdlDefinition.setDefinition(binding.getDefinition());
model.setBinding(binding.getElement());
} else {
warning("WsdlBindingDoesNotMatch", wsdlDefinition, model.getBindingName());
}
}
if (model.getServiceName() != null) {
WSDLObject<Service> service = wsdlDefinition.getWSDLObject(Service.class, model.getServiceName());
if (service != null) {
wsdlDefinition.setDefinition(service.getDefinition());
model.setService(service.getElement());
if (model.getPortName() != null) {
Port port = service.getElement().getPort(model.getPortName());
if (port != null) {
model.setPort(port);
model.setBinding(port.getBinding());
} else {
warning("WsdlPortTypeDoesNotMatch", wsdlDefinition, model.getPortName());
}
}
} else {
warning("WsdlServiceDoesNotMatch", wsdlDefinition, model.getServiceName());
}
}
PortType portType = getPortType(model);
if (portType != null) {
// Introspect the WSDL portType and validate the input/output messages.
List<OperationImpl> operations = portType.getOperations();
for (OperationImpl operation : operations) {
if (operation.getInput() != null && operation.getInput().getMessage() == null) {
ContributionResolveException ce = new ContributionResolveException("WSDL binding operation input name " + operation.getInput().getName() + " does not match with PortType Definition");
error("ContributionResolveException", wsdlDefinition, ce);
}
if (operation.getOutput() != null && operation.getOutput().getMessage() == null) {
ContributionResolveException ce = new ContributionResolveException("WSDL binding operation output name " + operation.getOutput().getName() + " does not match with PortType Definition");
error("ContributionResolveException", wsdlDefinition, ce);
}
}
WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract();