Author: midon
Date: Thu Jun 26 19:27:16 2008
New Revision: 672080
URL: http://svn.apache.org/viewvc?rev=672080&view=rev
Log:
ODE-307: Allows missing parts in urlReplacement pattern
Modified:
ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpBindingValidator.java
ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/Messages.java
ode/branches/APACHE_ODE_1.1/axis2/src/test/resources/http-binding-validator.wsdl
Modified:
ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpBindingValidator.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpBindingValidator.java?rev=672080&r1=672079&r2=672080&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpBindingValidator.java
(original)
+++
ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpBindingValidator.java
Thu Jun 26 19:27:16 2008
@@ -141,8 +141,10 @@
String name = (String) it.next();
Pattern p = Pattern.compile(".*(\\(" + name + "\\)).*");
Matcher m = p.matcher(locationUri);
- // is there a regex to do both validations in one?
- if (!m.matches() || locationUri.split("(\\(" + name + "\\))",
-1).length != 2) {
+ // WSLD spec requires that all message parts must be exactly
once in the url pattern.
+ // However ODE relaxes this.
+ // The only test is to make sure a part is not mentionned more
than once
+ if (m.matches() && locationUri.split("(\\(" + name + "\\))",
-1).length != 2) {
throw new
IllegalArgumentException(httpMsgs.msgInvalidURIPattern(binding,
bindingOperation, locationUri));
}
}
Modified:
ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/Messages.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/Messages.java?rev=672080&r1=672079&r2=672080&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/Messages.java
(original)
+++
ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/Messages.java
Thu Jun 26 19:27:16 2008
@@ -56,7 +56,7 @@
}
public String msgInvalidURIPattern(Binding binding, BindingOperation
operation, String locationUri) {
- return format("Invalid URI Pattern : all parts must be mentioned
exactly once! binding:{0}, operation:{1}, locationUri:{2}", binding.getQName(),
operation.getName(), locationUri);
+ return format("Invalid URI Pattern : parts must not be mentioned more
than once! binding:{0}, operation:{1}, locationUri:{2}", binding.getQName(),
operation.getName(), locationUri);
}
public String msgMimeMultipartRelatedUnsupported(Binding binding,
BindingOperation operation) {
Modified:
ode/branches/APACHE_ODE_1.1/axis2/src/test/resources/http-binding-validator.wsdl
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/test/resources/http-binding-validator.wsdl?rev=672080&r1=672079&r2=672080&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.1/axis2/src/test/resources/http-binding-validator.wsdl
(original)
+++
ode/branches/APACHE_ODE_1.1/axis2/src/test/resources/http-binding-validator.wsdl
Thu Jun 26 19:27:16 2008
@@ -381,7 +381,7 @@
</wsdl:binding>
<wsdl:binding
name="DummyServiceHttpBinding_get+urlReplacement+missing_part"
type="ns1:DummyServicePortType">
<wsdl:documentation>
- shouldFail # When urlReplacement used, all message parts must be
in the url pattern
+ shouldPass # WSLD spec requires that all message parts must be in
the url pattern when urlReplacement is used. However ODE relaxes this.
</wsdl:documentation>
<http:binding verb="GET"/>
<wsdl:operation name="hello">
@@ -396,7 +396,7 @@
</wsdl:binding>
<wsdl:binding
name="DummyServiceHttpBinding_get+urlReplacement+twice_the_same_part"
type="ns1:DummyServicePortType">
<wsdl:documentation>
- shouldFail # When urlReplacement used, all message parts must be
exactly ONCE in the url pattern
+ shouldFail # When urlReplacement used, message parts must not be
more than ONCE in the url pattern
</wsdl:documentation>
<http:binding verb="GET"/>
<wsdl:operation name="hello">