diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-ws/src/main')
2 files changed, 17 insertions, 0 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 e288d162d8..9c2bbd6043 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 @@ -22,6 +22,8 @@ package org.apache.tuscany.sca.binding.ws.xml; import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; +import java.net.URI; +import java.net.URISyntaxException; import java.util.Map; import javax.wsdl.Binding; @@ -33,6 +35,7 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; +import org.apache.tuscany.sca.assembly.Reference; import org.apache.tuscany.sca.assembly.xml.PolicySubjectProcessor; import org.apache.tuscany.sca.binding.ws.WebServiceBinding; import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory; @@ -131,6 +134,18 @@ public class WebServiceBindingProcessor extends BaseStAXArtifactProcessor implem String uri = getURIString(reader, URI); if (uri != null) { wsBinding.setURI(uri); + + if (context.getParentModel() instanceof Reference){ + try { + URI tmpURI = new URI(uri); + + if (!tmpURI.isAbsolute()){ + error(monitor, "URINotAbsolute", reader, uri); + } + } catch (URISyntaxException ex){ + error(monitor, "InvalidURISyntax", reader, ex.getMessage()); + } + } } // Read a qname in the form: 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 7a6cee4dc5..d8ecef91ef 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 @@ -25,6 +25,8 @@ WsdlBindingDoesNotMatch = The #wsdl.binding({0}) does not match with the WSDL De WsdlServiceDoesNotMatch = The #wsdl.service({0}) does not match with the WSDL Definitions WsdlPortTypeDoesNotMatch = The #wsdl.port({0}) does not match with the WSDL Definitions 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 |