[kaffe] kaffe and Jakarta's XMLRPC lib

Mark Maxham mark at maxham.com
Mon Feb 9 15:50:02 PST 2004


I'm having trouble with Jakarta's XMLRPC lib on kaffe 1.1.3, which I got 
from Debian:

Engine: Just-in-time v3   Version: 1.1.3   Java Version: 1.1

I extracted the guts of the XmlRpcClient into a little test app to see 
if I got the same odd behavior, and I did.

When I run this app, what I get on the other end is a POST request that 
looks correct except for one little detail: the content-length is zero! 
  Any idea why that might be happening?  This works fine on a Sun JVM.

BTW the url is made-up.  The server I'm poking at is behind my firewall.

Also, thanks for help with my previous question about https.

-----

import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;

public class PostTest
{
     public static void main(String[] args) throws Exception
     {
         byte[] request = "stinkoman".getBytes();
         URL url = new URL("http://www.foo.com/xmlrpc/");
         URLConnection con = url.openConnection();
         con.setDoInput(true);
         con.setDoOutput(true);
         con.setUseCaches(false);
         con.setAllowUserInteraction(false);
         con.setRequestProperty(
                 "Content-Length",
                 Integer.toString(request.length));
         con.setRequestProperty("Content-Type", "text/xml");

         OutputStream out = con.getOutputStream();
         out.write(request, 0, request.length);
         out.flush();
         out.close();
         InputStream in = con.getInputStream();
         in.close();
     }
}




More information about the kaffe mailing list