summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-12-14 13:11:02 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-12-14 13:11:02 +0000
commit37950aec04c2abce05e16d676ca97b4514ecff22 (patch)
tree20fe0a568527f6d1f995337065dc1eb6c0f8eaba /sca-java-2.x/trunk/modules
parentc22ac2250370b95585d5b6c99a7f3eef1c2caede (diff)
TUSCANY-2698 - merge changes from 1.x to 2.x. Only some of the changes merged as some affect error messages and cause otests to fail for only aesthetic reasons.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1214230 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r--sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java36
-rw-r--r--sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java11
-rw-r--r--sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties2
3 files changed, 39 insertions, 10 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java b/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
index 7cb3b89d48..052a1ced74 100644
--- a/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
+++ b/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
@@ -53,6 +53,7 @@ import org.apache.tuscany.sca.common.xml.stax.StAXHelper;
import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionRuntimeException;
import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXAttributeProcessor;
import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
@@ -135,6 +136,20 @@ public class WebServiceBindingProcessor extends BaseStAXArtifactProcessor implem
monitor.problem(problem);
}
}
+
+ /**
+ * Report an exception.
+ *
+ * @param problem
+ * @param model
+ * @param exception
+ */
+ private void error(Monitor monitor, String message, Object model, Exception ex) {
+ if (monitor != null) {
+ Problem problem = monitor.createProblem(this.getClass().getName(), "binding-wsxml-validation-messages", Severity.ERROR, model, message, ex);
+ monitor.problem(problem);
+ }
+ }
public WebServiceBinding read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
Monitor monitor = context.getMonitor();
@@ -420,9 +435,16 @@ public class WebServiceBindingProcessor extends BaseStAXArtifactProcessor implem
wsdlDefinition.setNameOfBindingToResolve(model.getBindingName());
wsdlDefinition.setNameOfServiceToResolve(model.getServiceName());
wsdlDefinition.getWsdliLocations().putAll(model.getWsdliLocations());
- WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition, context);
-
- if (!resolved.isUnresolved()) {
+ //WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition, context);
+ 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());
@@ -475,14 +497,14 @@ public class WebServiceBindingProcessor extends BaseStAXArtifactProcessor implem
WSDLInterface wsdlInterface = null;
try {
wsdlInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition, resolver, context.getMonitor());
- // save the wsdlDefinition that was used to generated the interface
+ // save the wsdlDefinition that was used to generate the interface
wsdlInterface.setWsdlDefinition(wsdlDefinition);
+ interfaceContract.setInterface(wsdlInterface);
+ interfaceContract.setCallbackInterface(wsdlInterface.getCallbackInterface());
+ model.setBindingInterfaceContract(interfaceContract);
} catch (InvalidInterfaceException e) {
warning(monitor, "InvalidInterfaceException", wsdlFactory, model.getName(), e.getMessage());
}
- interfaceContract.setInterface(wsdlInterface);
- interfaceContract.setCallbackInterface(wsdlInterface.getCallbackInterface());
- model.setBindingInterfaceContract(interfaceContract);
}
validateWSDL(context, model);
diff --git a/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java b/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
index 3c550d9781..3baed00daf 100644
--- a/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
+++ b/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
@@ -36,6 +36,7 @@ import org.apache.tuscany.sca.contribution.Artifact;
import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionRuntimeException;
import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
@@ -263,8 +264,14 @@ public class WSDLInterfaceProcessor extends BaseStAXArtifactProcessor implements
wsdlDefinition.setUnresolved(true);
wsdlDefinition.setNamespace(wsdlInterface.getName().getNamespaceURI());
wsdlDefinition.setNameOfPortTypeToResolve(wsdlInterface.getName());
- WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition, context);
- if (!resolved.isUnresolved()) {
+ 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());
diff --git a/sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties b/sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
index 101d9de60c..64c4a1b13e 100644
--- a/sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
+++ b/sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
@@ -19,7 +19,7 @@
#
#
ContributionReadException = ContributionReadException occured due to : {0}
-ContributionResolveException = ContributionResolveException occured due to : {0}
+ContributionResolveException = Error in contribution : {0}
InvalidWSDLInterfaceAttr = Invalid WSDL interface attribute: {0}
WsdlInterfaceDoesNotMatch = The WSDL referenced by the interface.wsdl interface as ({0}) cannot be found in this contribution or in any imports that this contribution makes
InvalidRemotableValue = The interface.wsdl interface {0} element can only have a remotable attribute with the value "true" as WSDL interface are assumed to be remotable by default. The value that was found is: {1}.