TheProjecter / sardine

Automatically exported from code.google.com/p/sardine
0 stars 0 forks source link

PUT doesn't change file content. #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Sardine sardine= SardineFactory.begin(...);
String url = "http://hqvolsps/sites/docu_dev/Documents/sample.txt";
IOUtils.copy(sardine.get(url), System.out);
System.out.println();
sardine.put(url, new ByteArrayInputStream("kjhkhkhkhkhj".getBytes("UTF-8")), 
"text/plain");
IOUtils.copy(sardine.get(url), System.out);
System.out.println();

What is the expected output? What do you see instead?

Expected: changed file after PUT.
Real: the same content as before.

What version of the product are you using?
From trunk.

On what operating system?
Windows XP.

What webdav server are you hitting?
Sharepoint, see logs.

What is in the server error logs?
Have no access to server logs.

Please provide any additional information below (including code examples and 
full stack traces with line numbers in them).
See attached client log.

Original issue reported on code.google.com by serge.sh...@gmail.com on 10 Jun 2011 at 10:27

GoogleCodeExporter commented 9 years ago
Client log:

Original comment by serge.sh...@gmail.com on 10 Jun 2011 at 10:29

Attachments:

GoogleCodeExporter commented 9 years ago
This looks like a server issue to me possibly because of an incompatibility 
with the _Expect: Continue_ handshake. The server responds that the file has 
been accepted although no Authorization header has been sent.

{{{
2011-06-10 14:25:16,360 [main] DEBUG org.apache.http.wire - >> "PUT 
/sites/docu_dev/Documents/sample.txt HTTP/1.1[\r][\n]"
2011-06-10 14:25:16,360 [main] DEBUG org.apache.http.wire - >> "Expect: 
100-continue[\r][\n]"
2011-06-10 14:25:16,360 [main] DEBUG org.apache.http.wire - >> "Content-Type: 
text/plain[\r][\n]"
2011-06-10 14:25:16,360 [main] DEBUG org.apache.http.wire - >> 
"Transfer-Encoding: chunked[\r][\n]"
2011-06-10 14:25:16,361 [main] DEBUG org.apache.http.wire - >> "Host: 
hqvolsps[\r][\n]"
2011-06-10 14:25:16,361 [main] DEBUG org.apache.http.wire - >> "Connection: 
Keep-Alive[\r][\n]"
2011-06-10 14:25:16,361 [main] DEBUG org.apache.http.wire - >> "User-Agent: 
Sardine/null[\r][\n]"
2011-06-10 14:25:16,361 [main] DEBUG org.apache.http.wire - >> "Cookie: 
WSS_KeepSessionAuthenticated=80[\r][\n]"
2011-06-10 14:25:16,361 [main] DEBUG org.apache.http.wire - >> "Cookie2: 
$Version=1[\r][\n]"
2011-06-10 14:25:16,361 [main] DEBUG org.apache.http.wire - >> "[\r][\n]"
2011-06-10 14:25:16,363 [main] DEBUG org.apache.http.wire - << "HTTP/1.1 100 
Continue[\r][\n]"
2011-06-10 14:25:16,363 [main] DEBUG org.apache.http.wire - << "[\r][\n]"
2011-06-10 14:25:16,363 [main] DEBUG org.apache.http.wire - >> "c[\r][\n]"
2011-06-10 14:25:16,363 [main] DEBUG org.apache.http.wire - >> "kjhkhkhkhkhj"
2011-06-10 14:25:16,363 [main] DEBUG org.apache.http.wire - >> "[\r][\n]"
2011-06-10 14:25:16,363 [main] DEBUG org.apache.http.wire - >> "0[\r][\n]"
2011-06-10 14:25:16,363 [main] DEBUG org.apache.http.wire - >> "[\r][\n]"
2011-06-10 14:25:16,366 [main] DEBUG org.apache.http.wire - << "HTTP/1.1 200 
OK[\r][\n]"
2011-06-10 14:25:16,366 [main] DEBUG org.apache.http.wire - << "Connection: 
close[\r][\n]"
2011-06-10 14:25:16,367 [main] DEBUG org.apache.http.wire - << "Date: Fri, 10 
Jun 2011 10:25:16 GMT[\r][\n]"
2011-06-10 14:25:16,367 [main] DEBUG org.apache.http.wire - << "Server: 
Microsoft-IIS/6.0[\r][\n]"
2011-06-10 14:25:16,367 [main] DEBUG org.apache.http.wire - << 
"MicrosoftSharePointTeamServices: 12.0.0.4518[\r][\n]"
2011-06-10 14:25:16,367 [main] DEBUG org.apache.http.wire - << "X-Powered-By: 
ASP.NET[\r][\n]"
2011-06-10 14:25:16,367 [main] DEBUG org.apache.http.wire - << "Content-Type: 
text/html; charset=windows-1251[\r][\n]"
2011-06-10 14:25:16,367 [main] DEBUG org.apache.http.wire - << "[\r][\n]"
}}}

Original comment by dkocher@sudo.ch on 10 Jun 2011 at 12:41

GoogleCodeExporter commented 9 years ago
Can you try to use the #upload method with the _expectContinue_ boolean flag 
set to false. (By default set to true to get a status response from the server 
before the method body is sent.) 

Original comment by dkocher@sudo.ch on 10 Jun 2011 at 12:44

GoogleCodeExporter commented 9 years ago

Original comment by dkocher@sudo.ch on 10 Jun 2011 at 12:44