When a non-existing resource is locked, server response is 201 with a lockDiscovery property in XML response body. WebDAV client always expects a 200 or 207 response and does not handle 201. If we modify parseResponse() method of LockMethod class as follows everything works fine: ============================== public void parseResponse(InputStream input) throws IOException, HttpException { if (status == HttpStatus.SC_OK || - status == HttpStatus.SC_MULTI_STATUS ) { + status == HttpStatus.SC_MULTI_STATUS || + status == HttpStatus.SC_CREATED ) { parseXMLResponse(input); - if ( (status == HttpStatus.SC_OK) && + if ( (status != HttpStatus.SC_MULTI_STATUS) && - (this.state instanceof WebdavState)) { String prefix = DOMUtils.findDavPrefix( =================================== I have tested this patch with IIS. Thanks -ravi
sorry, summary was not correct. Now its correct.
We need to verify the instanceof state also, mistakenly removed that line :( Now patch is fine. ============================== public void parseResponse(InputStream input) throws IOException, HttpException { if (status == HttpStatus.SC_OK || - status == HttpStatus.SC_MULTI_STATUS ) { + status == HttpStatus.SC_MULTI_STATUS || + status == HttpStatus.SC_CREATED ) { parseXMLResponse(input); - if ( (status == HttpStatus.SC_OK) && + if ( (status != HttpStatus.SC_MULTI_STATUS) && (this.state instanceof WebdavState)) { String prefix = DOMUtils.findDavPrefix( ===================================
This seems to be fixed in current trunk as well (at least first part of the patch is the same as in source, although code is quite different after the parseXmlResponse(input). Please reopen if you disagree.