Well, the first question that comes to mind is why you're shoving XML
documents through RMI rather than HTTP or some other protocol that's
oriented toward documents instead of objects.  In comparison, RMI has a ton
of overhead.  If the document represents some kind of object request, SOAP
would be another good protocol to look into.

If you're sure that RMI is the right way to go, the serialize classes might
do what you need.  They convert an object tree into a character stream that
represents the typical file-based XML format.  <element/> etc.  Converting
to text and back is a lot of overhead but it's probably faster than Java's
object serialization.

The classes are actually very simple to use.  Here's a snippet of code that
dumps a document into a String.

   OutputStream os = new ByteArrayOutputStream();
   XMLSerializer xmls = new XMLSerializer( os, new OutputFormat() );
   xmls.serialize( doc );
   return os.toString();


----- Original Message -----
From: "Wilson W. Farrell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 30, 2002 6:22 PM
Subject: Newbie: XML over RMI


> Does anyone know of some examples I can follow.  I am attempting to send
> an XML document to a remote host via RMI.  What is the best way to do
> this?  My first thought was to use the Serializer classes in
> org.apache.xml.serialize and just sending the results over the wire
> through a method call.  However I found the classes weren't documented
> very well beyond the cryptic javadocs.
>
> Am I way off here?
>
> Thanks,
>
>   wilson
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to