Thanx Dirk, I got  the following response headers from the server. I attached the sequence with the source code in the txt file.
In short, I got
                            HTTP/1.1 200 OK
                            Content-Length: 0
                            Date: Tue, 28 Aug 2001 09:48:03 GMT
                            Server: Apache Tomcat/4.0-b3 (HTTP/1.1 Connector)
 
but when I again get the Properties using PROPFIND the value that I set to that resource is not updated. Whats wrong with me?.
 
----- Original Message -----
Sent: Tuesday, August 28, 2001 2:28 PM
Subject: RE: PROPATCH

 
Just a typo, it should be PROPPATCH not PROPATCH
 
Dirk
 



=============== Outbound Message Headers ===========

PROPPATCH /webdav/Domain.xml HTTP/1.1
Host: localhost:8080
Connection: TE
TE: trailers, deflate, gzip, compress
Content-Length: 313

=============== Outbound Message Body ==============

<?xml version="1.0" encoding="utf-8" ?>
   <D:propertyupdate xmlns:D="DAV:"
   xmlns:Z="http://www.w3.com/standards/z39.50/";>
     <D:set>
          <D:prop>
               <D:resourcetype>
               XML File
               </D:resourcetype>
          </D:prop>
     </D:set>
   </D:propertyupdate>

=============== Inbound Stream =================

HTTP/1.1 200 OK
Content-Length: 0
Date: Tue, 28 Aug 2001 09:53:49 GMT
Server: Apache Tomcat/4.0-b3 (HTTP/1.1 Connector)

==================== SOURCE CODE THAT GENERATES THIS ERROR MESSAGE IS ===============

import java.io.*;
import java.util.*;
import java.net.*;

import com.businex.database.webdav.methods.*;
import com.businex.database.common.*;
import com.businex.database.common.util.*;

import java.net.*;

public class Proppatch   {

    static HTTPConnection con;
    static Request req;
    static Response res;


//    static Socket con;


        
/**
 *  Main 
 *  @param String[]
 *  @return void
 */    
    public static void main(String args[]) throws Exception    {
            String address = InetAddress.getLocalHost().toString();
            String host = address.substring(address.lastIndexOf("/")+1);
            con = new HTTPConnection(host,8080);
            InputStream is = con.getInputStream();
            OutputStream  os = con.getOutputStream();

String  body  =    "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n";
        body +=    "   <D:propertyupdate xmlns:D=\"DAV:\"\r\n";
        body +=    "   xmlns:Z=\"http://www.w3.com/standards/z39.50/\";>\r\n";
        body +=    "     <D:set>\r\n";
        body +=    "          <D:prop>\r\n";
        body +=    "               <D:resourcetype>\r\n";
        body +=    "               XML File\r\n";
        body +=    "               </D:resourcetype>\r\n";
        body +=    "          </D:prop>\r\n";
        body +=    "     </D:set>\r\n";
        body +=    "   </D:propertyupdate>";


        os.write("\n\nPROPPATCH /webdav/Domain.xml HTTP/1.1".getBytes());
        os.write("\nHost: localhost:8080".getBytes());
        os.write("\nConnection: TE".getBytes());
        os.write("\nTE: trailers, deflate, gzip, compress".getBytes());
        os.write(("Content-Length: "+body.length()).getBytes());
        os.write("\n\n".getBytes());
        os.write(body.getBytes());


        System.out.println("\n\n =============== Outbound Message Headers 
================= \n\n");

        System.out.println("\nPROPPATCH /webdav/Domain.xml HTTP/1.1");
        System.out.println("Host: localhost:8080");
        System.out.println("Connection: TE");
        System.out.println("TE: trailers, deflate, gzip, compress");
        System.out.println("Content-Length: "+body.length());

        System.out.println("\n\n");


        System.out.println("\n\n =============== Outbound Message Body 
================= \n\n");

        System.out.println(body);


        System.out.println("\n\n =============== Inbound Stream ================= 
\n\n");

        int ch=0;
        while ((ch = is.read())!=-1)
                System.out.print((char) ch);
    }   
}   
        


Reply via email to