users@jaxb.java.net

Re: marshalling over the network?

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 24 Jan 2005 08:46:59 -0800

ray_lukas wrote:
> I can marshal to a local file just fine. Is there a way to marshal this
> model to a remote machine over IP with JaxB. Un-Marshalling (converting an
> XML file to a Java Model) is simple, Marshalling (Exporting that model to a
> xml file on another node) is not so simple.

JAXB can write to arbitrary OutputStream, so that should be suffice to
connect JAXB to arbitrary transportation layer.

But I'd do the URLConnection and do HTTP POST to the server. Using
URLConnection should be pretty straight-forward. There should be a
plenty of resources on the web to help you, too. Such as [1]. In this
way, you can use servlet on the server, which should be easy enough, too.

There are all sorts of ways to send a byte sequence from one machine to
another. You can use plain-old socket connection, you can use JavaMail,
FTP would work, too.

I thought I already pointed you toward URLConnection. If you are still
having trouble using it, you should seek a help from a support forum for
that.


[1]
http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net