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 Yuriy Zubarev <yu...@yahoo.ca> on 2002/02/03 09:18:34 UTC

Just started

Hello everyone,

I'm a complete rookie in this WebDAV realm and basically
I'm interested in development of client side for querying WebDAV
resource. First I downloaded HTTPClient from Jakarta Commons
and decided to try it in conjunction with PropFindMethod object from
client API of Slide. After managing in this way I got
java.lang.NoSuchFieldError
exception and got an expression that Slide maintained its own
version HTTPClient, is it true in any way? What I was trying to achieve
was to create test program that connects to a site, sends 'propfind' request
with XML schema and dumps on the screen server's response
(what's the best way to get it done?). Then I thought that
WebdavResource object was what I need but playing around
with it I didn't get far. So I would like to ask people
if there is some 'hello world' examples out there for client-side
application to talk with WebDAV resources.

Thank you for your time.

Best of luck,
Yuriy Zubarev









_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Just started

Posted by Yuriy Zubarev <yu...@yahoo.ca>.
Dirk,

Thanks a lot for your reply. I went with Slide's
version of HttpClient and advanced further until I got
to the point where I would like to ask for help again.

During my interaction with a remote WebDAV server
it sends 401 request for Digest Access Authentication (MD5)
and my client, I assume, automatically tries to perform
authentication but failed with a message:

"HTTP Exception: No credentials given, Status Code: -2"

Setting up credentials for HttpClient makes no sense
since the server expects MD5 authentication. The first
question I have is if there is way to turn off auto-authentication
feature of HttpClient and the second if client side API
of Slide provides means to carry out MD5 validation.
If no - no big deal, I can do it manually yet to do this
I need to read headers of a response from the server
and though it seems like very common task, I cannot
find anything in client API to make it happen.

Thank you for your time.

Best of luck,
Yuriy Zubarev





----- Original Message -----
From: "Dirk Verbeeck" <di...@pandora.be>
To: "Slide Users List" <sl...@jakarta.apache.org>
Sent: Sunday, February 03, 2002 2:43 PM
Subject: Re: Just started


> Slide uses HttpClient version 1.x.
> Actually it was devellopped over here and moved over to commons 7 months
> ago. During this move the API was changed and isn't usable anymore with
> slide.
> Use the version in Slide CVS to have a compatible version.
>
> You can use the HttpClient directly to execute a method:
> HttpClient client=new HttpClient();
> client.startSession("localhost",8080,new Credentials("dirk","dirk"));
> client.setDebug(10);
> MkcolMethod mc=new MkcolMethod();
> mc.setPath("/slide/files/newpath");
> client.executeMethod(mc);
> client.endSession();
>
> Or use the WebdavResource interface:
> HttpURL httpUrl      = new HttpURL("http://localhost:8080/slide");
> httpUrl.setUserInfo("root","root");
> WebdavResource webDR = new WebdavResource(httpUrl);
> System.out.println(webDR.getStatusMessage());
>
> Both the HttpClient and WebdavResource have a setDebug method to dump
> the request/response to screen.
>
> If you only want to test a server use the slide cmd-line client.
> It also has a "set debug on" command.
>
>
> Dirk
>
> Yuriy Zubarev wrote:
> >
> > Hello everyone,
> >
> > I'm a complete rookie in this WebDAV realm and basically
> > I'm interested in development of client side for querying WebDAV
> > resource. First I downloaded HTTPClient from Jakarta Commons
> > and decided to try it in conjunction with PropFindMethod object from
> > client API of Slide. After managing in this way I got
> > java.lang.NoSuchFieldError
> > exception and got an expression that Slide maintained its own
> > version HTTPClient, is it true in any way? What I was trying to achieve
> > was to create test program that connects to a site, sends 'propfind'
request
> > with XML schema and dumps on the screen server's response
> > (what's the best way to get it done?). Then I thought that
> > WebdavResource object was what I need but playing around
> > with it I didn't get far. So I would like to ask people
> > if there is some 'hello world' examples out there for client-side
> > application to talk with WebDAV resources.
> >
> > Thank you for your time.
> >
> > Best of luck,
> > Yuriy Zubarev
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Just started

Posted by Dirk Verbeeck <di...@pandora.be>.
Slide uses HttpClient version 1.x.
Actually it was devellopped over here and moved over to commons 7 months
ago. During this move the API was changed and isn't usable anymore with
slide.
Use the version in Slide CVS to have a compatible version.

You can use the HttpClient directly to execute a method:
HttpClient client=new HttpClient();
client.startSession("localhost",8080,new Credentials("dirk","dirk"));
client.setDebug(10);
MkcolMethod mc=new MkcolMethod();		
mc.setPath("/slide/files/newpath");
client.executeMethod(mc);
client.endSession();

Or use the WebdavResource interface:
HttpURL httpUrl      = new HttpURL("http://localhost:8080/slide");
httpUrl.setUserInfo("root","root");
WebdavResource webDR = new WebdavResource(httpUrl);
System.out.println(webDR.getStatusMessage());

Both the HttpClient and WebdavResource have a setDebug method to dump
the request/response to screen.

If you only want to test a server use the slide cmd-line client.
It also has a "set debug on" command.


Dirk

Yuriy Zubarev wrote:
> 
> Hello everyone,
> 
> I'm a complete rookie in this WebDAV realm and basically
> I'm interested in development of client side for querying WebDAV
> resource. First I downloaded HTTPClient from Jakarta Commons
> and decided to try it in conjunction with PropFindMethod object from
> client API of Slide. After managing in this way I got
> java.lang.NoSuchFieldError
> exception and got an expression that Slide maintained its own
> version HTTPClient, is it true in any way? What I was trying to achieve
> was to create test program that connects to a site, sends 'propfind' request
> with XML schema and dumps on the screen server's response
> (what's the best way to get it done?). Then I thought that
> WebdavResource object was what I need but playing around
> with it I didn't get far. So I would like to ask people
> if there is some 'hello world' examples out there for client-side
> application to talk with WebDAV resources.
> 
> Thank you for your time.
> 
> Best of luck,
> Yuriy Zubarev


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


preStoreContent method needs to access RevisionContent if postStoreContent needs to access RevisionContent

Posted by Akil <as...@swbell.net>.
A strange phenomenon has been observed.

I created a new ContentInterceptor sub-class.

If I access the document content ( using RevisionContent ) in the
preStoreContent method of the ContentInterceptor class,
I can then see non-zero length content in the postStoreContent method of the
ContentInterceptor class.

If I do not access the document content ( i.e. do not call any of the
methods of the RevisionContent object ) in the preStoreContent method of
the ContentInterceptor class, then the RevisionContent object in the
postStoreContent method is empty ( has 0 length content ).

Is this is a misuse or is this a bug?

On an aside:

Although the revisionContent object gets passed to the postRemoveContent
method of the ContentInterceptor ( Note: this is post JP's UserQuota
changes ),
any attempt at accessing content ( thru RevisionContent methods ) in the
postRemoveContent method leads to exceptions and a transaction rollback ( on
the remove).

Akil




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>