You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Neil Padgen <ne...@mon.bbc.co.uk> on 2004/10/11 18:30:54 UTC

Binding with the WebDAV client

Hi,

I'm trying to bind a newly created resource to another name using the
webdav servlet in 2.1b1.  My WebdavResource claims that the bind has
worked, and so does the server log, but there is no sign of the resource
when I look in the collection.

Demo program:


#v+

package testing;

import javax.ejb.EJBException;

import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpURL;
import org.apache.webdav.lib.WebdavResource;

public class PutSomethingInSlide {

    public static void main(String[] args) throws Exception {
        WebdavResource container = null;
        HttpURL url = new HttpURL("http://localhost:8080/slide/files/items/");
        container = new WebdavResource(url);
        if (container == null) {
            throw new EJBException("Container WebdavResource is null!");
        }
        container.putMethod("/slide/files/items/hello.txt",
                "Hello world\n");
        url = new HttpURL("http://localhost:8080/slide/files/items/hello.txt");
        WebdavResource item = new WebdavResource(url);
        if (item == null) {
            throw new EJBException("Item WebdavResource is null!");
        }
        
        // now let's try binding it to another name
        boolean result = item.bindMethod(
                "/slide/files/items/helloagain.txt");
        System.out.println("bindMethod result: " + result);
        url = new HttpURL("http://localhost:8080/slide/files/items/helloagain.txt");
        try {
            WebdavResource boundItem = new WebdavResource(url);
            System.out.println("boundItem existence: " + boundItem.getExistence());
        } catch (HttpException e) {
            System.out.println("no boundItem: " + e.getMessage());
            e.printStackTrace();
        }
    }
}

#v-

Server log extract:

2004-10-11 16:27:40,820 INFO  [STDOUT] http-0.0.0.0-8080-Processor24, 11-Oct-2004 16:27:40, unauthenticated, PROPFIND, 207 "Multi-Status", 17 ms, /files/items/
2004-10-11 16:27:41,049 INFO  [STDOUT] http-0.0.0.0-8080-Processor24, 11-Oct-2004 16:27:40, unauthenticated, PUT, 204 "No Content", 52 ms, /files/items/hello.txt
2004-10-11 16:27:41,082 INFO  [STDOUT] http-0.0.0.0-8080-Processor25, 11-Oct-2004 16:27:41, unauthenticated, PROPFIND, 207 "Multi-Status", 23 ms, /files/items/hello.txt
2004-10-11 16:27:41,141 INFO  [STDOUT] http-0.0.0.0-8080-Processor25, 11-Oct-2004 16:27:41, unauthenticated, BIND, 201 "Created", 21 ms, /files/items
2004-10-11 16:27:41,176 INFO  [STDOUT] http-0.0.0.0-8080-Processor23, 11-Oct-2004 16:27:41, unauthenticated, PROPFIND, 404 "Not Found", 25 ms, /files/items/helloagain.txt

Domain.xml is configured as a MySQL-backed BindingStore.  slide.properties
has org.apache.slide.binding=true.

There are a few reports of similar problems in the mailing list archives,
but I couldn't find a solution.

All help gratefully received!

Regards

-- Neil


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org