When WebdavResource.propfindMethod( String ) is called with a namespaced property such as 'http://example.com/ns:customproperty', incorrect XML is sent over the wire (note the extra colon at the end of the namespace): <D:propfind xmlns:D="DAV:"> <D:prop> <ZZ:customproperty xmlns:ZZ="http://example.com/ns:"> </ZZ:customproperty> </D:prop> </D:propfind> Passing the property in as a Vector containing a PropertyName, the correct XML is sent over the wire. It seems like there is an off-by-one error in PropFindMethod.setPropertyNames(Enumeration): Index: clientlib/src/java/org/apache/webdav/lib/methods/PropFindMethod.java =================================================================== --- clientlib/src/java/org/apache/webdav/lib/methods/PropFindMethod.java (revision 583601) +++ clientlib/src/java/org/apache/webdav/lib/methods/PropFindMethod.java (working copy) @@ -284,7 +284,7 @@ if ((i == 1) || (i >= length)) { list.add(new PropertyName("DAV:",propertyName)); } else { - String namespace = propertyName.substring(0, length + 1 - i); + String namespace = propertyName.substring(0, length - i); String localName = propertyName.substring(length + 1 - i); list.add(new PropertyName(namespace,localName)); } This patch seems to fix the issue, although it seems like this bit of code is meant to deal nicely with multi-byte characters?
Created attachment 20952 [details] Fixes off-by-one error This is the same patch that is in the body of the bug description.