You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Aaron G <he...@yahoo.com> on 2001/08/27 23:58:35 UTC

For complexTypes....question

If I have a complex type which is a struct
of primitives and Strings

options {
   long foo;
   int bar;
   String baz;
}


How can I serialize that struct with a options.class
file?  I have a WSDL, which contains all the info
I need about it, what would I have to do to make
that struct serialize correctly?

Thanks, Aaron

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Re: For complexTypes....question

Posted by Glen Daniels <gd...@macromedia.com>.
There are a couple of answers to this.

The core answer is "you want an options class which the TypeMappingRegistry
in Axis maps to/from a particular schema type".   How you get there is the
question.

1) You can custom-build an options.java file and register
serializers/deserializers for it.  This option is easiest if the XML is
fairly straightforward and the options class is a bean (has get/set
accessors), since the serialization work will be done for you by the
BeanSerializer.  Alternately, you can code up custom
serializers/deserializers which know how to map your class to/from XML
(there are examples of this in Axis).

2) You can use a proxy-generation tool to read the WSDL file and
automatically generate an options class for you.  We're working on this, but
it's not there yet.

For now, the BeanSerializer approach is the easiest by far.

--Glen

----- Original Message -----
From: "Aaron G" <he...@yahoo.com>
To: <ax...@xml.apache.org>
Sent: Monday, August 27, 2001 5:58 PM
Subject: For complexTypes....question


> If I have a complex type which is a struct
> of primitives and Strings
>
> options {
>    long foo;
>    int bar;
>    String baz;
> }
>
>
> How can I serialize that struct with a options.class
> file?  I have a WSDL, which contains all the info
> I need about it, what would I have to do to make
> that struct serialize correctly?
>
> Thanks, Aaron
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>