You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by jason harrop <jh...@bigpond.net.au> on 2000/11/27 12:07:59 UTC

client/src/org/apache/webdav/lib/methods/PropMethodBase.java

Hi

I've started to play with the webdav stuff in slide.

I'm using the command line client code as a base to access the web dav
servlet (both ends using jar files built from the CVS sources of this
morning).

When I use PropPatch, I get a 207 response and then the error:

java.lang.IllegalArgumentException: XML parsing error; input is not
valid XML: The markup in the document following the root element must be
well-formed.
	at
org.apache.webdav.lib.methods.PropMethodBase.parseResponse(PropMethodBase.java:142)
	at
org.apache.webdav.lib.WebdavClient.executeMethod(WebdavClient.java:225)
	at Main.main(Main.java:148)

This is because responseDocument contains something which looks like it
came from a GET request, eg: 

<head><title>Document moved</title></head>
<body><h1>Document moved</h1>
This document has moved <a
href="http://192.168.1.9:8081/index.html">here</a>.<p>
</body>

or 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd>
<!--NewPage-->
<HTML>
<HEAD>
:
</HTML>

respectively.

I appreciate that this code is actively being developed and you guys
might already know about this.

cheers,

Jason

Re: client/src/org/apache/webdav/lib/methods/PropMethodBase.java

Posted by Remy Maucherat <re...@apache.org>.
> Hi
>
> I've started to play with the webdav stuff in slide.
>
> I'm using the command line client code as a base to access the web dav
> servlet (both ends using jar files built from the CVS sources of this
> morning).
>
> When I use PropPatch, I get a 207 response and then the error:
>
> java.lang.IllegalArgumentException: XML parsing error; input is not
> valid XML: The markup in the document following the root element must be
> well-formed.
> at
>
org.apache.webdav.lib.methods.PropMethodBase.parseResponse(PropMethodBase.ja
va:142)
> at
> org.apache.webdav.lib.WebdavClient.executeMethod(WebdavClient.java:225)
> at Main.main(Main.java:148)
>
> This is because responseDocument contains something which looks like it
> came from a GET request, eg:
>
> <head><title>Document moved</title></head>
> <body><h1>Document moved</h1>
> This document has moved <a
> href="http://192.168.1.9:8081/index.html">here</a>.<p>
> </body>
>
> or
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
> "http://www.w3.org/TR/REC-html40/loose.dtd>
> <!--NewPage-->
> <HTML>
> <HEAD>
> :
> </HTML>
>
> respectively.
>
> I appreciate that this code is actively being developed and you guys
> might already know about this.
>
> cheers,
>
> Jason

If you're using Slide's webapp, you should access the servlet through the
/slide/ path. The root path is NOT WebDAV enabled. In Tomcat 4's default
config, the /webdav/ path is also DAV enabled.
However, you pointed out a missing feature in the client : IMO, just as it
automatically responds to auth challenges, it should also automatically
follow redirections. After we implement that, you'll get a 501 (method not
supported).

Remy


Re: client/src/org/apache/webdav/lib/methods/PropMethodBase.java

Posted by Jason Harrop <jh...@bigpond.net.au>.
"B.C. Holmes" wrote:
> 
> Jason Harrop wrote:
> >
> > oops, please disregard previous post, at least in part.
> >
> > actually, my problem is that i can never get the 207 response, or indeed
> > any xml which looks like it might be a response to a PropPatch request.
> > i ended up saying i could, because i used a debug line which said
> > System.out.println(WebdavStatus.SC_MULTI_STATUS) - dah!
> 
>      Just so's I understand, though, were you forcibly changing the
> status code in the method response?  

In effect .. I had inserted in PropMethodBase.parseResponse

	System.out.println(WebdavStatus.SC_MULTI_STATUS)

to find out what was going on, when i meant:

	System.out.println( getStatusCode() )

(it was not my time of the day), so it was telling me it was getting a
207 response.

And, i was also using getResponseDocument() to see what was coming back
- please bear with me as i try to understand both the WebDav protocol
and slide's implementation by playing with Slide!

> The parse method should not have
> tried to parse the XML content if the return code wasn't
> SC_MULTI_STATUS.

In short, it wasn't.

Thanks

Jason
 
> BCing you
> --
> B.C. Holmes         \u2625           http://www.roxton.com/~bcholmes/
> "Wherefore now, baby, time will tell/I chose my roads and I chose
>  them well/But will I go forth, or just go to hell/For I am a
>  terrible man."
>          - Jory Nash, _Terrible Man_

Re: client/src/org/apache/webdav/lib/methods/PropMethodBase.java

Posted by Remy Maucherat <re...@apache.org>.
> Jason Harrop wrote:
> >
> > oops, please disregard previous post, at least in part.
> >
> > actually, my problem is that i can never get the 207 response, or indeed
> > any xml which looks like it might be a response to a PropPatch request.
> > i ended up saying i could, because i used a debug line which said
> > System.out.println(WebdavStatus.SC_MULTI_STATUS) - dah!
>
>      Just so's I understand, though, were you forcibly changing the
> status code in the method response?  The parse method should not have
> tried to parse the XML content if the return code wasn't
> SC_MULTI_STATUS.

I saw that in the code. At first, I thought you had forgotten it, but
they're there.

The HTTP spec only recommends doing that for GET and HEAD, so that's what I
did.
A 207 in response to PROPFIND would be weird. I didn't hardcode the method
names, so it's easy to add other methods.

Remy


Re: client/src/org/apache/webdav/lib/methods/PropMethodBase.java

Posted by "B.C. Holmes" <bc...@roxton.com>.
Jason Harrop wrote:
> 
> oops, please disregard previous post, at least in part.
> 
> actually, my problem is that i can never get the 207 response, or indeed
> any xml which looks like it might be a response to a PropPatch request.
> i ended up saying i could, because i used a debug line which said
> System.out.println(WebdavStatus.SC_MULTI_STATUS) - dah!

     Just so's I understand, though, were you forcibly changing the
status code in the method response?  The parse method should not have
tried to parse the XML content if the return code wasn't
SC_MULTI_STATUS.

BCing you
-- 
B.C. Holmes         \u2625           http://www.roxton.com/~bcholmes/
"Wherefore now, baby, time will tell/I chose my roads and I chose 
 them well/But will I go forth, or just go to hell/For I am a 
 terrible man."
         - Jory Nash, _Terrible Man_

Re: client/src/org/apache/webdav/lib/methods/PropMethodBase.java

Posted by Jason Harrop <jh...@bigpond.net.au>.
oops, please disregard previous post, at least in part.

actually, my problem is that i can never get the 207 response, or indeed
any xml which looks like it might be a response to a PropPatch request. 
i ended up saying i could, because i used a debug line which said
System.out.println(WebdavStatus.SC_MULTI_STATUS) - dah!   

until i did this, all i ever got was something which looks like a
response to a GET request. i was a bit surprised when the behaviour
changed when i recompiled slde and stuck my debug back in.  so sorry for
the trouble - me, i'll go back and study webdavservlet, which was my
plan before i managed to fake the 207.

cheers,

jason
> 
> Hi
> 
> I've started to play with the webdav stuff in slide.
> 
> I'm using the command line client code as a base to access the web dav
> servlet (both ends using jar files built from the CVS sources of this
> morning).
> 
> When I use PropPatch, I get a 207 response and then the error:
> 
> java.lang.IllegalArgumentException: XML parsing error; input is not
> valid XML: The markup in the document following the root element must be
> well-formed.
>         at
> org.apache.webdav.lib.methods.PropMethodBase.parseResponse(PropMethodBase.java:142)
>         at
> org.apache.webdav.lib.WebdavClient.executeMethod(WebdavClient.java:225)
>         at Main.main(Main.java:148)
> 
> This is because responseDocument contains something which looks like it
> came from a GET request, eg:
> 
> <head><title>Document moved</title></head>
> <body><h1>Document moved</h1>
> This document has moved <a
> href="http://192.168.1.9:8081/index.html">here</a>.<p>
> </body>
> 
> or
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
> "http://www.w3.org/TR/REC-html40/loose.dtd>
> <!--NewPage-->
> <HTML>
> <HEAD>
> :
> </HTML>
> 
> respectively.
> 
> I appreciate that this code is actively being developed and you guys
> might already know about this.
> 
> cheers,
> 
> Jason