From d6ed6920c75de949294a6dc29eff5e2a3c1b08ac Mon Sep 17 00:00:00 2001 From: slaws Date: Mon, 21 Jun 2010 09:18:29 +0000 Subject: BWS_2003 - add a check that wsdl.service doesn't appear on a service binding.ws element git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@956511 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java | 6 ++++++ .../src/main/resources/binding-wsxml-validation-messages.properties | 1 + 2 files changed, 7 insertions(+) (limited to 'sca-java-2.x/trunk/modules') 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 9c2bbd6043..4863088cd5 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 @@ -135,6 +135,7 @@ public class WebServiceBindingProcessor extends BaseStAXArtifactProcessor implem if (uri != null) { wsBinding.setURI(uri); + // BWS20001 if (context.getParentModel() instanceof Reference){ try { URI tmpURI = new URI(uri); @@ -164,6 +165,11 @@ public class WebServiceBindingProcessor extends BaseStAXArtifactProcessor implem String localName = wsdlElement.substring(index + 1); if (localName.startsWith("wsdl.service")) { + // BWS20003 + if (context.getParentModel() instanceof org.apache.tuscany.sca.assembly.Service){ + error(monitor, "WSDLServiceOnService", reader, wsdlElement); + } + // Read a wsdl.service localName = localName.substring("wsdl.service(".length(), localName.length() - 1); wsBinding.setServiceName(new QName(namespace, localName)); diff --git a/sca-java-2.x/trunk/modules/binding-ws/src/main/resources/binding-wsxml-validation-messages.properties b/sca-java-2.x/trunk/modules/binding-ws/src/main/resources/binding-wsxml-validation-messages.properties index d8ecef91ef..4e88c5bcce 100644 --- a/sca-java-2.x/trunk/modules/binding-ws/src/main/resources/binding-wsxml-validation-messages.properties +++ b/sca-java-2.x/trunk/modules/binding-ws/src/main/resources/binding-wsxml-validation-messages.properties @@ -27,6 +27,7 @@ WsdlPortTypeDoesNotMatch = The #wsdl.port({0}) does not match with the WSDL Defi WsdliLocationMissingWsdlElement = binding.ws has a @wsdli:wsdlLocation attribute but no @wsdlElement attribute URINotAbsolute = [BWS20001] The URI value for binding.ws on an SCA reference must be absolute. Non-absolute value found {0} InvalidURISyntax = The URI value {0} found on binding.ws has invalid syntax +WSDLServiceOnService = [BWS20003] The wsdlElement attribute of a binding.ws on an SCA service must not specify the wsdl.service form of URI. The following URI was found {0} -- cgit v1.2.3