wsdlDefinition.setNameOfPortTypeToResolve(wsdlInterface.getName());
WSDLDefinition resolved = null;
try {
resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition, context);
} catch (ContributionRuntimeException e) {
ContributionResolveException ce = new ContributionResolveException(e.getCause());
error(monitor, "ContributionResolveException", wsdlDefinition, 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);
WSDLObject<PortType> portType = wsdlDefinition.getWSDLObject(PortType.class, wsdlInterface.getName());
if (portType != null) {
// Introspect the WSDL portType and add the resulting
// WSDLInterface to the resolver
try {
wsdlDefinition.setDefinition(portType.getDefinition());
WSDLInterface newWSDLInterface = wsdlFactory.createWSDLInterface(portType.getElement(), wsdlDefinition, resolver, monitor);
newWSDLInterface.setWsdlDefinition(wsdlDefinition);
newWSDLInterface.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
newWSDLInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
resolver.addModel(newWSDLInterface, context);
wsdlInterface = newWSDLInterface;
} catch (InvalidInterfaceException e) {
String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
"interface-wsdlxml-validation-messages",
"InvalidInterface");
message = message.replace("{0}", portType.toString());
ContributionResolveException ce = new ContributionResolveException(message, e);
error(monitor, "ContributionResolveException", wsdlFactory, ce);
//throw ce;
} // end try
}
else {
warning(monitor, "WsdlInterfaceDoesNotMatch", wsdlDefinition, wsdlInterface.getName());
} // end if
} else {
// If we get here, the WSDLDefinition is unresolved...
String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
"interface-wsdlxml-validation-messages",
"WSDLDefinitionUnresolved");
message = message.replace("{0}", wsdlInterface.getName().toString());
ContributionResolveException ce = new ContributionResolveException(message);
error(monitor, "ContributionResolveException", wsdlFactory, ce);
} // end if
} // end if
} // end if
return wsdlInterface;