tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r1214230 - in /tuscany/sca-java-2.x/trunk/modules: binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/ interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ interface-wsdl/src/main/resources/
Date Wed, 14 Dec 2011 13:11:02 GMT
Author: slaws
Date: Wed Dec 14 13:11:02 2011
New Revision: 1214230

URL: http://svn.apache.org/viewvc?rev=1214230&view=rev
Log:
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. 

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
    tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
    tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties

Modified: tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java?rev=1214230&r1=1214229&r2=1214230&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java
Wed Dec 14 13:11:02 2011
@@ -53,6 +53,7 @@ import org.apache.tuscany.sca.common.xml
 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 
             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 
         wsdlDefinition.setNameOfBindingToResolve(model.getBindingName());
         wsdlDefinition.setNameOfServiceToResolve(model.getServiceName());
         wsdlDefinition.getWsdliLocations().putAll(model.getWsdliLocations());
-        WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition,
context);
+        //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.isUnresolved()) {
+        if (resolved != null && !resolved.isUnresolved()) {
             wsdlDefinition.setDefinition(resolved.getDefinition());
             wsdlDefinition.setLocation(resolved.getLocation());
             wsdlDefinition.setURI(resolved.getURI());
@@ -475,14 +497,14 @@ public class WebServiceBindingProcessor 
                 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);

Modified: tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java?rev=1214230&r1=1214229&r2=1214230&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
Wed Dec 14 13:11:02 2011
@@ -36,6 +36,7 @@ import org.apache.tuscany.sca.contributi
 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 exte
                 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());

Modified: tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties?rev=1214230&r1=1214229&r2=1214230&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
(original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
Wed Dec 14 13:11:02 2011
@@ -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}.



Mime
View raw message