users@jaxb.java.net

Re: marshal to an Output Stream which is derived from an urlConnection

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 21 Jan 2005 16:58:45 -0800

ray_lukas wrote:
> It is my understanding that JAXB can marshal to an Output Stream which is
> derived from an urlConnection. Is this correct?

I think you mean an OutputStream returned from URLConnection. Yes.

> Here is the code which I
> think should work. Certainly it marshals the ClientConfiguartion object to
> the fileOutPutStream. But not to the urlOutPutStream. Can anyone see why? I
> have been using JAXB for quite some time and it is great, but I have to get
> this working because I can not have these files sit on the client machines.

Given that the data marshals to a File just fine, I'd suspect an
operator error on the usage of URLConnection.

Perhaps this article
(http://www.javaworld.com/javaworld/jw-03-2001/jw-0323-traps.html)
helps? In particular, look at BadURLPost1.java in the middle of the
first page.

-- 
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