summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/interface-wsdl/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/interface-wsdl/src/main')
-rw-r--r--sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java39
-rw-r--r--sca-java-2.x/trunk/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties4
2 files changed, 30 insertions, 13 deletions
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 3baed00daf..cab4c963a8 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
@@ -22,10 +22,8 @@ package org.apache.tuscany.sca.interfacedef.wsdl.xml;
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import java.net.URI;
-import java.util.List;
import javax.wsdl.PortType;
-import javax.wsdl.WSDLElement;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
@@ -291,8 +289,12 @@ public class WSDLInterfaceProcessor extends BaseStAXArtifactProcessor implements
resolver.addModel(newWSDLInterface, context);
wsdlInterface = newWSDLInterface;
} catch (InvalidInterfaceException e) {
- ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
- portType.toString(), 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
@@ -302,8 +304,12 @@ public class WSDLInterfaceProcessor extends BaseStAXArtifactProcessor implements
} // end if
} else {
// If we get here, the WSDLDefinition is unresolved...
- ContributionResolveException ce = new ContributionResolveException("WSDLDefinition unresolved " +
- wsdlInterface.getName() );
+ 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
@@ -343,8 +349,11 @@ public class WSDLInterfaceProcessor extends BaseStAXArtifactProcessor implements
wsdlInterface.setWsdlDefinition(wsdlDefinition);
resolver.addModel(wsdlInterface, context);
} catch (InvalidInterfaceException e) {
- ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
- portType.toString(), 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);
Monitor.error(monitor, WSDLInterfaceProcessor.class.getName(),
"interface-wsdlxml-validation-messages", "ContributionResolveException",
wsdlFactory.getClass().getName(), ce.getMessage());
@@ -358,8 +367,11 @@ public class WSDLInterfaceProcessor extends BaseStAXArtifactProcessor implements
} // end if
} else {
// If we get here, the WSDLDefinition is unresolved...
- ContributionResolveException ce = new ContributionResolveException("WSDLDefinition unresolved " +
- wsdlInterface.getName() );
+ 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);
Monitor.error(monitor, WSDLInterfaceProcessor.class.getName(),
"interface-wsdlxml-validation-messages", "ContributionResolveException",
wsdlFactory.getClass().getName(), ce.getMessage());
@@ -456,8 +468,11 @@ public class WSDLInterfaceProcessor extends BaseStAXArtifactProcessor implements
newWSDLInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
wsdlInterface = newWSDLInterface;
} catch (InvalidInterfaceException e) {
- ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
- portType.toString(), 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);
}
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 64c4a1b13e..beab450b36 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
@@ -24,4 +24,6 @@ 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}.
IncompatibleCallbacks = The interface.wsdl element has a forward interface with a callback declared in the WSDL {0} and a callback interface also declared using the callbackInterface attribute {1} but the callback interfaces are not equal.
-wsdliLocationException = Exception locating wsdli:location resource: {0} \ No newline at end of file
+wsdliLocationException = Exception locating wsdli:location resource: {0}
+InvalidInterface = Invalid interface when resolving {0}
+WSDLDefinitionUnresolved = WSDLDefinition unresolved {0} \ No newline at end of file