The main problem i am facing is that , WebDAV server is running on Machine
A. Slide Client  PutMethod and PropFind methods from Machine B are able to
talk to WebDAV server running on Machine A. But the same Client code doesn't
function on Machine A throwing the below stacktrace. I don't understand the
reason for it. 

Thanks
Rama




-----Original Message-----
From: Remy Maucherat [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 9:00 PM
To: [EMAIL PROTECTED]
Subject: Re: Socket Exception


> >However, some forms of PROPFIND may be broken. Could you post any traces
/
> >error reports from the client side (as well as some code) ?
>
> >Remy
>
> Here is the src code
>
>
> public class TPut {
>   public static void main(String[] arg){
>     try{
>
>       int result=0;
>       WebdavClient client = new WebdavClient();
>       Credentials crd = new Credentials("root","admin");
>       client.setCredentials(crd);
>       client.startSession("localhost", 8080);
>       File f = new File("c:\\simple.txt");
>       FileInputStream fis= new FileInputStream(f);
>         PutMethod pm = new PutMethod();
>         String des = f.getPath();
>         pm.setPath("/slide/sql.txt");
>         pm.sendData(fis);
>         client.executeMethod(pm);
>
>
>     }catch(Exception e){
>       e.printStackTrace(System.out);
>       System.out.println(e.toString());
>     }
>   }
>   }
>
> And stacktrace is
>
> at org.apache.webdav.lib.WebdavClient.executeMethod(WebdavClient.java:393)
> at pra.TPut.main(TPut.java:41)
> org.apache.webdav.lib.WebdavException: Unable to process request

Thanks for the report. I should be able to reproduce any problem using that
:)

In your case, using this should be better :
       File f = new File("c:\\simple.txt");
         PutMethod pm = new PutMethod();
         String des = f.getPath();
         pm.setPath("/slide/sql.txt");
         pm.sendData(f);
         client.executeMethod(pm);

The other way is allowed and supported, but it should be more efficient.

Remy

Reply via email to