diff options
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-ws-xml/src')
2 files changed, 29 insertions, 8 deletions
diff --git a/branches/sca-java-1.x/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java b/branches/sca-java-1.x/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java index 15b58e499c..860daa647d 100644 --- a/branches/sca-java-1.x/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java +++ b/branches/sca-java-1.x/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java @@ -46,6 +46,7 @@ import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.resolver.ModelResolver; import org.apache.tuscany.sca.contribution.service.ContributionReadException; import org.apache.tuscany.sca.contribution.service.ContributionResolveException; +import org.apache.tuscany.sca.contribution.service.ContributionRuntimeException; import org.apache.tuscany.sca.contribution.service.ContributionWriteException; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.UtilityExtensionPoint; @@ -97,9 +98,9 @@ public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServ /** * Report a warning. * - * @param problems - * @param message + * @param problem * @param model + * @param message data */ private void warning(String message, Object model, Object... messageParameters) { if (monitor != null) { @@ -109,11 +110,11 @@ public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServ } /** - * Report a error. + * Report an error. * - * @param problems - * @param message + * @param problem * @param model + * @param message data */ private void error(String message, Object model, Object... messageParameters) { if (monitor != null) { @@ -122,6 +123,20 @@ public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServ } } + /** + * Report an exception. + * + * @param problem + * @param model + * @param exception + */ + private void error(String message, Object model, Exception ex) { + if (monitor != null) { + Problem problem = new ProblemImpl(this.getClass().getName(), "binding-wsxml-validation-messages", Severity.ERROR, model, message, ex); + monitor.problem(problem); + } + } + public WebServiceBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException { // Read a <binding.ws> @@ -322,7 +337,14 @@ public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServ WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition(); wsdlDefinition.setUnresolved(true); wsdlDefinition.setNamespace(model.getNamespace()); - WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition); + 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.isUnresolved()) { wsdlDefinition.setDefinition(resolved.getDefinition()); diff --git a/branches/sca-java-1.x/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties b/branches/sca-java-1.x/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties index 2dfa5e6133..9e2ff5830d 100644 --- a/branches/sca-java-1.x/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties +++ b/branches/sca-java-1.x/modules/binding-ws-xml/src/main/resources/binding-wsxml-validation-messages.properties @@ -24,5 +24,4 @@ InvalidInterfaceException = Exception creating interface from WSDL for binding: WsdlBindingDoesNotMatch = The #wsdl.binding({0}) does not match with the WSDL Definitions WsdlServiceDoesNotMatch = The #wsdl.service({0}) does not match with the WSDL Definitions WsdlPortTypeDoesNotMatch = The #wsdl.port({0}) does not match with the WSDL Definitions - - +ContributionResolveException = Error in contribution: {0} |