You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by "Marquez, Oscar" <os...@sapmarkets.com> on 2001/05/18 01:10:32 UTC

RE: Using SOAP libs to encode/decode java objects into/from XML f iles - but I want this to be automatic

Hi Thanks

	But I was looking for something more dynamic, I would using like
something to convert a java Object into a XML by using the reflection API. I
wouldn't like to all this work by hand.

	I was thinking that for the SOAP Protocol, you were converting the
java objects into XML using some automatic mechanic based on the reflection
API. It this right?

Regards,
Oscar.

-----Original Message-----
From: Naggi Rao [mailto:naggi@softhome.net]
Sent: Thursday, May 17, 2001 3:29 PM
To: soap-dev@xml.apache.org
Subject: Re: Using SOAP libs to encode/decode java objects into/from XML
files


Hi ,
Have a look at the getAddressFromName() method in the addressBook example.

Cheers,
Naggi


----- Original Message -----
From: "Marquez, Oscar" <os...@sapmarkets.com>
To: <so...@xml.apache.org>
Sent: Thursday, May 17, 2001 1:32 PM
Subject: Using SOAP libs to encode/decode java objects into/from XML files


> Hi SOAP Group
>
> I would like to know something that I guess you have already solved.
> How to convert a java object into a XML and how to read the object back.
>
> I don't know much about SOAP, but I have been using jBoss.org, and
> it works pretty well. But now I need to create a XML file to store some
> objects.
>
> I have tried to use XMLEncoder and XMLDecoder from the java.bean
> package under the jsr-000057 spec but it doesn't seem to work right, also
> you have to do a lot of work, you need the objects to be javabeans. I
tried
> JSX from http://freshmeat.net/projects/jsx, it works much better, but I
> can't read the objects back.
>
> Doesn't SOAP comes with some encoder/decoder. I guess so, but I need
> to get them, how can I get them? how to use them to accomplish this?
>
> Regards,
> Oscar
>
>

Re: Using SOAP libs to encode/decode java objects into/from XML files - but I want this to be automatic

Posted by Scott Nichol <sn...@computer.org>.
Oscar,

The BeanSerializer is close to what you are looking for.  It uses
introspection to determine the "properties" of a class, which it uses to
serialize and de-serialize instances thereof.  However, as discussed
previously on this list, it handles polymorphism in a manner that may be
undesirable for your purposes.  Specifically, it serializes properties based
on the type information from introspection, not the type of an instance.

Of course, being introspection-based, the BeanSerializer requires that the
classes you are working with are beans, specifically that they have accessor
and mutator methods that define the "properties" of instances of that class.
Since you apparently do not want to be limited to using beans, the
BeanSerializer does not address your needs.

Scott

----- Original Message -----
From: "Marquez, Oscar" <os...@sapmarkets.com>
To: <so...@xml.apache.org>
Sent: Thursday, May 17, 2001 7:10 PM
Subject: RE: Using SOAP libs to encode/decode java objects into/from XML
files - but I want this to be automatic


> Hi Thanks
>
> But I was looking for something more dynamic, I would using like
> something to convert a java Object into a XML by using the reflection API.
I
> wouldn't like to all this work by hand.
>
> I was thinking that for the SOAP Protocol, you were converting the
> java objects into XML using some automatic mechanic based on the
reflection
> API. It this right?
>
> Regards,
> Oscar.
>
> -----Original Message-----
> From: Naggi Rao [mailto:naggi@softhome.net]
> Sent: Thursday, May 17, 2001 3:29 PM
> To: soap-dev@xml.apache.org
> Subject: Re: Using SOAP libs to encode/decode java objects into/from XML
> files
>
>
> Hi ,
> Have a look at the getAddressFromName() method in the addressBook example.
>
> Cheers,
> Naggi
>
>
> ----- Original Message -----
> From: "Marquez, Oscar" <os...@sapmarkets.com>
> To: <so...@xml.apache.org>
> Sent: Thursday, May 17, 2001 1:32 PM
> Subject: Using SOAP libs to encode/decode java objects into/from XML files
>
>
> > Hi SOAP Group
> >
> > I would like to know something that I guess you have already solved.
> > How to convert a java object into a XML and how to read the object back.
> >
> > I don't know much about SOAP, but I have been using jBoss.org, and
> > it works pretty well. But now I need to create a XML file to store some
> > objects.
> >
> > I have tried to use XMLEncoder and XMLDecoder from the java.bean
> > package under the jsr-000057 spec but it doesn't seem to work right,
also
> > you have to do a lot of work, you need the objects to be javabeans. I
> tried
> > JSX from http://freshmeat.net/projects/jsx, it works much better, but I
> > can't read the objects back.
> >
> > Doesn't SOAP comes with some encoder/decoder. I guess so, but I need
> > to get them, how can I get them? how to use them to accomplish this?
> >
> > Regards,
> > Oscar
> >
> >


Re: Using SOAP libs to encode/decode java objects into/from XML files - but I want this to be automatic

Posted by Naggi Rao <na...@softhome.net>.
I would let the Gurus answer you Oscar..
I am just graduating from being a 'newbie'

Scott have any answers ?

Cheers,
Naggi


----- Original Message -----
From: "Marquez, Oscar" <os...@sapmarkets.com>
To: <so...@xml.apache.org>
Sent: Thursday, May 17, 2001 4:10 PM
Subject: RE: Using SOAP libs to encode/decode java objects into/from XML
files - but I want this to be automatic


> Hi Thanks
>
> But I was looking for something more dynamic, I would using like
> something to convert a java Object into a XML by using the reflection API.
I
> wouldn't like to all this work by hand.
>
> I was thinking that for the SOAP Protocol, you were converting the
> java objects into XML using some automatic mechanic based on the
reflection
> API. It this right?
>
> Regards,
> Oscar.
>
> -----Original Message-----
> From: Naggi Rao [mailto:naggi@softhome.net]
> Sent: Thursday, May 17, 2001 3:29 PM
> To: soap-dev@xml.apache.org
> Subject: Re: Using SOAP libs to encode/decode java objects into/from XML
> files
>
>
> Hi ,
> Have a look at the getAddressFromName() method in the addressBook example.
>
> Cheers,
> Naggi
>
>
> ----- Original Message -----
> From: "Marquez, Oscar" <os...@sapmarkets.com>
> To: <so...@xml.apache.org>
> Sent: Thursday, May 17, 2001 1:32 PM
> Subject: Using SOAP libs to encode/decode java objects into/from XML files
>
>
> > Hi SOAP Group
> >
> > I would like to know something that I guess you have already solved.
> > How to convert a java object into a XML and how to read the object back.
> >
> > I don't know much about SOAP, but I have been using jBoss.org, and
> > it works pretty well. But now I need to create a XML file to store some
> > objects.
> >
> > I have tried to use XMLEncoder and XMLDecoder from the java.bean
> > package under the jsr-000057 spec but it doesn't seem to work right,
also
> > you have to do a lot of work, you need the objects to be javabeans. I
> tried
> > JSX from http://freshmeat.net/projects/jsx, it works much better, but I
> > can't read the objects back.
> >
> > Doesn't SOAP comes with some encoder/decoder. I guess so, but I need
> > to get them, how can I get them? how to use them to accomplish this?
> >
> > Regards,
> > Oscar
> >
> >
>