You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Kaleb Walton <kd...@us.ibm.com> on 2007/11/06 14:55:20 UTC

Aegis databinding and Java 5 Generic List creating extra "anyType" field


Thanks to Aegis databinding I can specify the minOccurs on my primitive
fields so the WSDL contract doesn't force them to be required. However,
Aegis has introduced something else that I'm not familiar with. It may be
"proper" but I'm not familiar with it and it seems to add one more level of
a property between a field name and it's value.

I have an object defined as such:

class ServiceListResult<T> {
    private List<T> items;
    //getters/setters
}

T is a Java 5 generic class reference.

When using the Simple Server default data binding my object looked like
this when output from PHP:

[items] => Array
    (
        [0] => stdClass Object
            (
                ...
            )
     )

Now it looks like this:

[items] => sdtClass Object
    (
        [anyType] => Array
            (
                [0] => stdClass Object
                    (
                        ...
                    )
            )
     )


Is there any way to make the output look like the Simple Server did or is
this the "proper" output since I'm using generics?

Regards,
Kaleb

Re: Aegis databinding and Java 5 Generic List creating extra "anyType" field

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 07 November 2007, Benson Margulies wrote:
> I'm not sure that the flat thing is all that hard. I'd like to know
> what the other Dan thinks.

For Arrays internal to other objects, it's not that hard.    For arrays 
that are parameters to the SEI methods it's quite a bit harder.    That 
said, I had the same problem in JAXB (when not using generated 
doc/lit/wrapped wrapper objects)  so I've battled it before.    
(although, since the entire Aegis code is in our control, it's probably 
much easier)

Basically, the reasons I went with the wrapper types as part of the fix 
for CXF-1116 was that:
1) It was consistent with the arrays internal to the other objects
2) It HAS to be implemented that way for the rpc/lit case 
and 
3) It was easy to implement for the wrapped doc/lit case since the call 
path in this case is almost exactly the same as the rpc/lit case.

FYI: arrays to SEI methods using RPC/Lit will generate ArrayOf types with 
JAXB as well.   To get JAXB to NOT do the "ArrayOf" things for 
doc/lit/wrapped took a lot of work and separate call paths for the 
doc/lit/wrapped case compared to the doc/lit/bare and rpc/lit cases.


Dan


> > -----Original Message-----
> > From: Daniel Kulp [mailto:dkulp@apache.org]
> > Sent: Wednesday, November 07, 2007 1:25 PM
> > To: cxf-user@incubator.apache.org
> > Cc: Kaleb Walton
> > Subject: Re: Aegis databinding and Java 5 Generic List creating
> > extra "anyType" field
> >
> > > This is *quite* undesirable. Does anyone have any suggestions for
> > > a workaround?
> >
> > At this point, I think the only options are:
> >
> > 1) Switch to jaxb (which doesn't do this)
> >
> > 2) Start writing the code to do the "flat" stuff.      Patches are
>
> more
>
> > than welcome.   :-)
> >
> > Dan
> >
> > On Wednesday 07 November 2007, Kaleb Walton wrote:
> > > Darn! I think that's it... I'm looking at the output of all of my
> > > arrays and they fork in this extra level which is given the name
> > > of the class of the object type stored in the array.
> > >
> > > Example:
> > > Note the extra 'ServiceFieldError' level that shouldn't be there
> > > and also note the 'fieldErrors' property that should actually be
> > > of type Array.
> > >
> > >                     [fieldErrors] => stdClass Object
> > >                         (
> > >                             [ServiceFieldError] => Array
> > >                                 (
> > >                                     [0] => stdClass Object
> > >                                         (
> > >                                             [code] =>
>
> errors.required
>
> > >                                             [defaultMessage] =>
>
> Field
>
> > > is required
> > >                                             [field] => foo
> > >                                             [rejectedValue] => Foo
> > >                                         )
> > >
> > >                                     [1] => stdClass Object
> > >                                         (
> > >                                             [code] =>
>
> errors.required
>
> > >                                             [defaultMessage] =>
>
> Field
>
> > > is required
> > >                                             [field] => bar
> > >                                             [rejectedValue] => 1
> > >                                         )
> > >
> > >                                 )
> > >
> > >                         )
> > >
> > > This is *quite* undesirable. Does anyone have any suggestions for
> > > a workaround?
> > >
> > > Regards,
> > > Kaleb
> > >
> > > |------------>
> > > | From:      |
> > > |------------>
> >
> >-------------------------------------------------------------------
> >
> >-------------------------------------------------------------------
> >
> > >   >------------|
> > >   >
> > >   |"Benson Margulies" <bi...@basistech.com>
> >
> >-------------------------------------------------------------------
> >
> >-------------------------------------------------------------------
> >
> > >   >------------|
> > > |
> > > |------------>
> > > | To:        |
> > > |------------>
> >
> >-------------------------------------------------------------------
> >
> >-------------------------------------------------------------------
> >
> > >   >------------|
> > >   >
> > >   |<cx...@incubator.apache.org>
> >
> >-------------------------------------------------------------------
> >
> >-------------------------------------------------------------------
> >
> > >   >------------|
> > > |
> > > |------------>
> > > | Date:      |
> > > |------------>
> >
> >-------------------------------------------------------------------
> >
> >-------------------------------------------------------------------
> >
> > >   >------------|
> > >   >
> > >   |11/06/2007 11:49 AM
> >
> >-------------------------------------------------------------------
> >
> >-------------------------------------------------------------------
> >
> > >   >------------|
> > > |
> > > |------------>
> > > | Subject:   |
> > > |------------>
> >
> >-------------------------------------------------------------------
> >
> >-------------------------------------------------------------------
> >
> > >   >------------|
> > >   >
> > >   |RE: Aegis databinding and Java 5 Generic List creating extra
> > >   | "anyType" field
> >
> >-------------------------------------------------------------------
> >
> >-------------------------------------------------------------------
> >
> > >   >------------|
> > >
> > > The 'flat' feature is an attribute in the mapping schema that was
> > > intended to control some cases of either adding an extra level of
> > > type/element or not. Apparently, it isn't this one. While the code
>
> to
>
> > > parse the attribute exists, the code to actually pay attention to
> > > it does not.
> > >
> > >
> > >
> > > ________________________________
> > >
> > > From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> > > Sent: Tuesday, November 06, 2007 11:27 AM
> > > To: cxf-user@incubator.apache.org
> > > Subject: RE: Aegis databinding and Java 5 Generic List creating
>
> extra
>
> > > "anyType" field
> > >
> > >
> > >
> > > Thanks for the reply. Unfortunately nillable is already set to
>
> false.
>
> > > What is the 'flat' feature? I can't imagine that I'm the only
> > > person having the problem.
> > >
> > > Do you know if there is a way to specify something in an aegis.xml
> > > config that tells the 'items' list to not add the 'anyType'
>
> property?
>
> > > Regards,
> > > Kaleb
> > >
> > > Inactive hide details for "Benson Margulies" ---11/06/2007
> > > 08:58:14 AM---If you set nillable to false it might do what you
> > > want"Benson Margulies" ---11/06/2007 08:58:14 AM---If you set
> > > nillable to false
>
> it
>
> > > might do what you want. On the other
> > >
> > >
> > > From:
> > >
> > >
> > > "Benson Margulies" <bi...@basistech.com>
> > >
> > >
> > > To:
> > >
> > >
> > > <cx...@incubator.apache.org>
> > >
> > >
> > > Date:
> > >
> > >
> > > 11/06/2007 08:58 AM
> > >
> > >
> > > Subject:
> > >
> > >
> > > RE: Aegis databinding and Java 5 Generic List creating extra
>
> "anyType"
>
> > > field
> > >
> > > ________________________________
> > >
> > >
> > >
> > >
> > > If you set nillable to false it might do what you want. On the
> > > other hand, it might be that this is the never-implemented 'flat'
> > > feature
>
> of
>
> > > Aegis.
> > >
> > > > -----Original Message-----
> > > > From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> > > > Sent: Tuesday, November 06, 2007 8:55 AM
> > > > To: cxf-user@incubator.apache.org
> > > > Subject: Aegis databinding and Java 5 Generic List creating
> > > > extra "anyType" field
> > > >
> > > >
> > > >
> > > > Thanks to Aegis databinding I can specify the minOccurs on my
> > >
> > > primitive
> > >
> > > > fields so the WSDL contract doesn't force them to be required.
> > >
> > > However,
> > >
> > > > Aegis has introduced something else that I'm not familiar with.
> > > > It may
> > >
> > > be
> > >
> > > > "proper" but I'm not familiar with it and it seems to add one
> > > > more
> > >
> > > level
> > >
> > > > of
> > > > a property between a field name and it's value.
> > > >
> > > > I have an object defined as such:
> > > >
> > > > class ServiceListResult<T> {
> > > >     private List<T> items;
> > > >     //getters/setters
> > > > }
> > > >
> > > > T is a Java 5 generic class reference.
> > > >
> > > > When using the Simple Server default data binding my object
> > > > looked
> > >
> > > like
> > >
> > > > this when output from PHP:
> > > >
> > > > [items] => Array
> > > >     (
> > > >         [0] => stdClass Object
> > > >             (
> > > >                 ...
> > > >             )
> > > >      )
> > > >
> > > > Now it looks like this:
> > > >
> > > > [items] => sdtClass Object
> > > >     (
> > > >         [anyType] => Array
> > > >             (
> > > >                 [0] => stdClass Object
> > > >                     (
> > > >                         ...
> > > >                     )
> > > >             )
> > > >      )
> > > >
> > > >
> > > > Is there any way to make the output look like the Simple Server
>
> did
>
> > > > or
> > >
> > > is
> > >
> > > > this the "proper" output since I'm using generics?
> > > >
> > > > Regards,
> > > > Kaleb
> >
> > --
> > J. Daniel Kulp
> > Principal Engineer
> > IONA
> > P: 781-902-8727    C: 508-380-7194
> > daniel.kulp@iona.com
> > http://www.dankulp.com/blog



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

RE: Aegis databinding and Java 5 Generic List creating extra "anyType" field

Posted by Benson Margulies <bi...@basistech.com>.
I'm not sure that the flat thing is all that hard. I'd like to know what
the other Dan thinks.

> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Wednesday, November 07, 2007 1:25 PM
> To: cxf-user@incubator.apache.org
> Cc: Kaleb Walton
> Subject: Re: Aegis databinding and Java 5 Generic List creating extra
> "anyType" field
> 
> 
> > This is *quite* undesirable. Does anyone have any suggestions for a
> > workaround?
> 
> At this point, I think the only options are:
> 
> 1) Switch to jaxb (which doesn't do this)
> 
> 2) Start writing the code to do the "flat" stuff.      Patches are
more
> than welcome.   :-)
> 
> Dan
> 
> 
> On Wednesday 07 November 2007, Kaleb Walton wrote:
> > Darn! I think that's it... I'm looking at the output of all of my
> > arrays and they fork in this extra level which is given the name of
> > the class of the object type stored in the array.
> >
> > Example:
> > Note the extra 'ServiceFieldError' level that shouldn't be there and
> > also note the 'fieldErrors' property that should actually be of type
> > Array.
> >
> >                     [fieldErrors] => stdClass Object
> >                         (
> >                             [ServiceFieldError] => Array
> >                                 (
> >                                     [0] => stdClass Object
> >                                         (
> >                                             [code] =>
errors.required
> >                                             [defaultMessage] =>
Field
> > is required
> >                                             [field] => foo
> >                                             [rejectedValue] => Foo
> >                                         )
> >
> >                                     [1] => stdClass Object
> >                                         (
> >                                             [code] =>
errors.required
> >                                             [defaultMessage] =>
Field
> > is required
> >                                             [field] => bar
> >                                             [rejectedValue] => 1
> >                                         )
> >
> >                                 )
> >
> >                         )
> >
> > This is *quite* undesirable. Does anyone have any suggestions for a
> > workaround?
> >
> > Regards,
> > Kaleb
> >
> > |------------>
> > | From:      |
> > |------------>
> > |
> >
>-------------------------------------------------------------------
> >
>-------------------------------------------------------------------
> >   >------------|
> >   >
> >   |"Benson Margulies" <bi...@basistech.com>
> >   |
> >   |            |
> >   |
> >
>-------------------------------------------------------------------
> >
>-------------------------------------------------------------------
> >   >------------|
> > |
> > |------------>
> > | To:        |
> > |------------>
> > |
> >
>-------------------------------------------------------------------
> >
>-------------------------------------------------------------------
> >   >------------|
> >   >
> >   |<cx...@incubator.apache.org>
> >   |
> >   |            |
> >   |
> >
>-------------------------------------------------------------------
> >
>-------------------------------------------------------------------
> >   >------------|
> > |
> > |------------>
> > | Date:      |
> > |------------>
> > |
> >
>-------------------------------------------------------------------
> >
>-------------------------------------------------------------------
> >   >------------|
> >   >
> >   |11/06/2007 11:49 AM
> >   |
> >   |            |
> >   |
> >
>-------------------------------------------------------------------
> >
>-------------------------------------------------------------------
> >   >------------|
> > |
> > |------------>
> > | Subject:   |
> > |------------>
> > |
> >
>-------------------------------------------------------------------
> >
>-------------------------------------------------------------------
> >   >------------|
> >   >
> >   |RE: Aegis databinding and Java 5 Generic List creating extra
> >   | "anyType" field
> >   |                   |
> >   |
> >
>-------------------------------------------------------------------
> >
>-------------------------------------------------------------------
> >   >------------|
> >
> > The 'flat' feature is an attribute in the mapping schema that was
> > intended to control some cases of either adding an extra level of
> > type/element or not. Apparently, it isn't this one. While the code
to
> > parse the attribute exists, the code to actually pay attention to it
> > does not.
> >
> >
> >
> > ________________________________
> >
> > From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> > Sent: Tuesday, November 06, 2007 11:27 AM
> > To: cxf-user@incubator.apache.org
> > Subject: RE: Aegis databinding and Java 5 Generic List creating
extra
> > "anyType" field
> >
> >
> >
> > Thanks for the reply. Unfortunately nillable is already set to
false.
> >
> > What is the 'flat' feature? I can't imagine that I'm the only person
> > having the problem.
> >
> > Do you know if there is a way to specify something in an aegis.xml
> > config that tells the 'items' list to not add the 'anyType'
property?
> >
> > Regards,
> > Kaleb
> >
> > Inactive hide details for "Benson Margulies" ---11/06/2007 08:58:14
> > AM---If you set nillable to false it might do what you want"Benson
> > Margulies" ---11/06/2007 08:58:14 AM---If you set nillable to false
it
> > might do what you want. On the other
> >
> >
> > From:
> >
> >
> > "Benson Margulies" <bi...@basistech.com>
> >
> >
> > To:
> >
> >
> > <cx...@incubator.apache.org>
> >
> >
> > Date:
> >
> >
> > 11/06/2007 08:58 AM
> >
> >
> > Subject:
> >
> >
> > RE: Aegis databinding and Java 5 Generic List creating extra
"anyType"
> > field
> >
> > ________________________________
> >
> >
> >
> >
> > If you set nillable to false it might do what you want. On the other
> > hand, it might be that this is the never-implemented 'flat' feature
of
> > Aegis.
> >
> > > -----Original Message-----
> > > From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> > > Sent: Tuesday, November 06, 2007 8:55 AM
> > > To: cxf-user@incubator.apache.org
> > > Subject: Aegis databinding and Java 5 Generic List creating extra
> > > "anyType" field
> > >
> > >
> > >
> > > Thanks to Aegis databinding I can specify the minOccurs on my
> >
> > primitive
> >
> > > fields so the WSDL contract doesn't force them to be required.
> >
> > However,
> >
> > > Aegis has introduced something else that I'm not familiar with. It
> > > may
> >
> > be
> >
> > > "proper" but I'm not familiar with it and it seems to add one more
> >
> > level
> >
> > > of
> > > a property between a field name and it's value.
> > >
> > > I have an object defined as such:
> > >
> > > class ServiceListResult<T> {
> > >     private List<T> items;
> > >     //getters/setters
> > > }
> > >
> > > T is a Java 5 generic class reference.
> > >
> > > When using the Simple Server default data binding my object looked
> >
> > like
> >
> > > this when output from PHP:
> > >
> > > [items] => Array
> > >     (
> > >         [0] => stdClass Object
> > >             (
> > >                 ...
> > >             )
> > >      )
> > >
> > > Now it looks like this:
> > >
> > > [items] => sdtClass Object
> > >     (
> > >         [anyType] => Array
> > >             (
> > >                 [0] => stdClass Object
> > >                     (
> > >                         ...
> > >                     )
> > >             )
> > >      )
> > >
> > >
> > > Is there any way to make the output look like the Simple Server
did
> > > or
> >
> > is
> >
> > > this the "proper" output since I'm using generics?
> > >
> > > Regards,
> > > Kaleb
> 
> 
> 
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog

Re: Aegis databinding and Java 5 Generic List creating extra "anyType" field

Posted by Kaleb Walton <kd...@us.ibm.com>.
Thank you for laying it out plainly! I've found another reason why Aegis
doesn't work for our circumstances so I'm going to go back to jaxb to see
if theres something that will solve my minOccurs="1" on primitives issue :)

Regards,
Kaleb


                                                                                                                             
  From:       Daniel Kulp <dk...@apache.org>                                                                                 
                                                                                                                             
  To:         cxf-user@incubator.apache.org                                                                                  
                                                                                                                             
  Cc:         Kaleb Walton/Southfield/IBM@IBMUS                                                                              
                                                                                                                             
  Date:       11/07/2007 01:25 PM                                                                                            
                                                                                                                             
  Subject:    Re: Aegis databinding and Java 5 Generic List creating extra "anyType" field                                   
                                                                                                                             






> This is *quite* undesirable. Does anyone have any suggestions for a
> workaround?

At this point, I think the only options are:

1) Switch to jaxb (which doesn't do this)

2) Start writing the code to do the "flat" stuff.      Patches are more
than welcome.   :-)

Dan


On Wednesday 07 November 2007, Kaleb Walton wrote:
> Darn! I think that's it... I'm looking at the output of all of my
> arrays and they fork in this extra level which is given the name of
> the class of the object type stored in the array.
>
> Example:
> Note the extra 'ServiceFieldError' level that shouldn't be there and
> also note the 'fieldErrors' property that should actually be of type
> Array.
>
>                     [fieldErrors] => stdClass Object
>                         (
>                             [ServiceFieldError] => Array
>                                 (
>                                     [0] => stdClass Object
>                                         (
>                                             [code] => errors.required
>                                             [defaultMessage] => Field
> is required
>                                             [field] => foo
>                                             [rejectedValue] => Foo
>                                         )
>
>                                     [1] => stdClass Object
>                                         (
>                                             [code] => errors.required
>                                             [defaultMessage] => Field
> is required
>                                             [field] => bar
>                                             [rejectedValue] => 1
>                                         )
>
>                                 )
>
>                         )
>
> This is *quite* undesirable. Does anyone have any suggestions for a
> workaround?
>
> Regards,
> Kaleb
>
> |------------>
> | From:      |
> |------------>
> |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
>   >
>   |"Benson Margulies" <bi...@basistech.com>
>   |
>   |            |
>   |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
> |
> |------------>
> | To:        |
> |------------>
> |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
>   >
>   |<cx...@incubator.apache.org>
>   |
>   |            |
>   |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
> |
> |------------>
> | Date:      |
> |------------>
> |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
>   >
>   |11/06/2007 11:49 AM
>   |
>   |            |
>   |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
> |
> |------------>
> | Subject:   |
> |------------>
> |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
>   >
>   |RE: Aegis databinding and Java 5 Generic List creating extra
>   | "anyType" field
>   |                   |
>   |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
>
> The 'flat' feature is an attribute in the mapping schema that was
> intended to control some cases of either adding an extra level of
> type/element or not. Apparently, it isn't this one. While the code to
> parse the attribute exists, the code to actually pay attention to it
> does not.
>
>
>
> ________________________________
>
> From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> Sent: Tuesday, November 06, 2007 11:27 AM
> To: cxf-user@incubator.apache.org
> Subject: RE: Aegis databinding and Java 5 Generic List creating extra
> "anyType" field
>
>
>
> Thanks for the reply. Unfortunately nillable is already set to false.
>
> What is the 'flat' feature? I can't imagine that I'm the only person
> having the problem.
>
> Do you know if there is a way to specify something in an aegis.xml
> config that tells the 'items' list to not add the 'anyType' property?
>
> Regards,
> Kaleb
>
> Inactive hide details for "Benson Margulies" ---11/06/2007 08:58:14
> AM---If you set nillable to false it might do what you want"Benson
> Margulies" ---11/06/2007 08:58:14 AM---If you set nillable to false it
> might do what you want. On the other
>
>
> From:
>
>
> "Benson Margulies" <bi...@basistech.com>
>
>
> To:
>
>
> <cx...@incubator.apache.org>
>
>
> Date:
>
>
> 11/06/2007 08:58 AM
>
>
> Subject:
>
>
> RE: Aegis databinding and Java 5 Generic List creating extra "anyType"
> field
>
> ________________________________
>
>
>
>
> If you set nillable to false it might do what you want. On the other
> hand, it might be that this is the never-implemented 'flat' feature of
> Aegis.
>
> > -----Original Message-----
> > From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> > Sent: Tuesday, November 06, 2007 8:55 AM
> > To: cxf-user@incubator.apache.org
> > Subject: Aegis databinding and Java 5 Generic List creating extra
> > "anyType" field
> >
> >
> >
> > Thanks to Aegis databinding I can specify the minOccurs on my
>
> primitive
>
> > fields so the WSDL contract doesn't force them to be required.
>
> However,
>
> > Aegis has introduced something else that I'm not familiar with. It
> > may
>
> be
>
> > "proper" but I'm not familiar with it and it seems to add one more
>
> level
>
> > of
> > a property between a field name and it's value.
> >
> > I have an object defined as such:
> >
> > class ServiceListResult<T> {
> >     private List<T> items;
> >     //getters/setters
> > }
> >
> > T is a Java 5 generic class reference.
> >
> > When using the Simple Server default data binding my object looked
>
> like
>
> > this when output from PHP:
> >
> > [items] => Array
> >     (
> >         [0] => stdClass Object
> >             (
> >                 ...
> >             )
> >      )
> >
> > Now it looks like this:
> >
> > [items] => sdtClass Object
> >     (
> >         [anyType] => Array
> >             (
> >                 [0] => stdClass Object
> >                     (
> >                         ...
> >                     )
> >             )
> >      )
> >
> >
> > Is there any way to make the output look like the Simple Server did
> > or
>
> is
>
> > this the "proper" output since I'm using generics?
> >
> > Regards,
> > Kaleb



--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: Aegis databinding and Java 5 Generic List creating extra "anyType" field

Posted by Daniel Kulp <dk...@apache.org>.
> This is *quite* undesirable. Does anyone have any suggestions for a
> workaround?

At this point, I think the only options are:

1) Switch to jaxb (which doesn't do this)

2) Start writing the code to do the "flat" stuff.      Patches are more 
than welcome.   :-)

Dan


On Wednesday 07 November 2007, Kaleb Walton wrote:
> Darn! I think that's it... I'm looking at the output of all of my
> arrays and they fork in this extra level which is given the name of
> the class of the object type stored in the array.
>
> Example:
> Note the extra 'ServiceFieldError' level that shouldn't be there and
> also note the 'fieldErrors' property that should actually be of type
> Array.
>
>                     [fieldErrors] => stdClass Object
>                         (
>                             [ServiceFieldError] => Array
>                                 (
>                                     [0] => stdClass Object
>                                         (
>                                             [code] => errors.required
>                                             [defaultMessage] => Field
> is required
>                                             [field] => foo
>                                             [rejectedValue] => Foo
>                                         )
>
>                                     [1] => stdClass Object
>                                         (
>                                             [code] => errors.required
>                                             [defaultMessage] => Field
> is required
>                                             [field] => bar
>                                             [rejectedValue] => 1
>                                         )
>
>                                 )
>
>                         )
>
> This is *quite* undesirable. Does anyone have any suggestions for a
> workaround?
>
> Regards,
> Kaleb
>
> |------------>
> | From:      |
> |------------>
> |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
>   >
>   |"Benson Margulies" <bi...@basistech.com>                         
>   |                                                                   
>   |            |
>   |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
> |
> |------------>
> | To:        |
> |------------>
> |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
>   >
>   |<cx...@incubator.apache.org>                                    
>   |                                                                   
>   |            |
>   |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
> |
> |------------>
> | Date:      |
> |------------>
> |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
>   >
>   |11/06/2007 11:49 AM                                                
>   |                                                                   
>   |            |
>   |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
> |
> |------------>
> | Subject:   |
> |------------>
> |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
>   >
>   |RE: Aegis databinding and Java 5 Generic List creating extra
>   | "anyType" field                                                   
>   |                   |
>   |
>   >-------------------------------------------------------------------
>   >-------------------------------------------------------------------
>   >------------|
>
> The 'flat' feature is an attribute in the mapping schema that was
> intended to control some cases of either adding an extra level of
> type/element or not. Apparently, it isn't this one. While the code to
> parse the attribute exists, the code to actually pay attention to it
> does not.
>
>
>
> ________________________________
>
> From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> Sent: Tuesday, November 06, 2007 11:27 AM
> To: cxf-user@incubator.apache.org
> Subject: RE: Aegis databinding and Java 5 Generic List creating extra
> "anyType" field
>
>
>
> Thanks for the reply. Unfortunately nillable is already set to false.
>
> What is the 'flat' feature? I can't imagine that I'm the only person
> having the problem.
>
> Do you know if there is a way to specify something in an aegis.xml
> config that tells the 'items' list to not add the 'anyType' property?
>
> Regards,
> Kaleb
>
> Inactive hide details for "Benson Margulies" ---11/06/2007 08:58:14
> AM---If you set nillable to false it might do what you want"Benson
> Margulies" ---11/06/2007 08:58:14 AM---If you set nillable to false it
> might do what you want. On the other
>
>
> From:
>
>
> "Benson Margulies" <bi...@basistech.com>
>
>
> To:
>
>
> <cx...@incubator.apache.org>
>
>
> Date:
>
>
> 11/06/2007 08:58 AM
>
>
> Subject:
>
>
> RE: Aegis databinding and Java 5 Generic List creating extra "anyType"
> field
>
> ________________________________
>
>
>
>
> If you set nillable to false it might do what you want. On the other
> hand, it might be that this is the never-implemented 'flat' feature of
> Aegis.
>
> > -----Original Message-----
> > From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> > Sent: Tuesday, November 06, 2007 8:55 AM
> > To: cxf-user@incubator.apache.org
> > Subject: Aegis databinding and Java 5 Generic List creating extra
> > "anyType" field
> >
> >
> >
> > Thanks to Aegis databinding I can specify the minOccurs on my
>
> primitive
>
> > fields so the WSDL contract doesn't force them to be required.
>
> However,
>
> > Aegis has introduced something else that I'm not familiar with. It
> > may
>
> be
>
> > "proper" but I'm not familiar with it and it seems to add one more
>
> level
>
> > of
> > a property between a field name and it's value.
> >
> > I have an object defined as such:
> >
> > class ServiceListResult<T> {
> >     private List<T> items;
> >     //getters/setters
> > }
> >
> > T is a Java 5 generic class reference.
> >
> > When using the Simple Server default data binding my object looked
>
> like
>
> > this when output from PHP:
> >
> > [items] => Array
> >     (
> >         [0] => stdClass Object
> >             (
> >                 ...
> >             )
> >      )
> >
> > Now it looks like this:
> >
> > [items] => sdtClass Object
> >     (
> >         [anyType] => Array
> >             (
> >                 [0] => stdClass Object
> >                     (
> >                         ...
> >                     )
> >             )
> >      )
> >
> >
> > Is there any way to make the output look like the Simple Server did
> > or
>
> is
>
> > this the "proper" output since I'm using generics?
> >
> > Regards,
> > Kaleb



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

RE: Aegis databinding and Java 5 Generic List creating extra "anyType" field

Posted by Kaleb Walton <kd...@us.ibm.com>.
Darn! I think that's it... I'm looking at the output of all of my arrays
and they fork in this extra level which is given the name of the class of
the object type stored in the array.

Example:
Note the extra 'ServiceFieldError' level that shouldn't be there and also
note the 'fieldErrors' property that should actually be of type Array.

                    [fieldErrors] => stdClass Object
                        (
                            [ServiceFieldError] => Array
                                (
                                    [0] => stdClass Object
                                        (
                                            [code] => errors.required
                                            [defaultMessage] => Field is
required
                                            [field] => foo
                                            [rejectedValue] => Foo
                                        )

                                    [1] => stdClass Object
                                        (
                                            [code] => errors.required
                                            [defaultMessage] => Field is
required
                                            [field] => bar
                                            [rejectedValue] => 1
                                        )

                                )

                        )

This is *quite* undesirable. Does anyone have any suggestions for a
workaround?

Regards,
Kaleb


|------------>
| From:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |"Benson Margulies" <bi...@basistech.com>                                                                                                        |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |<cx...@incubator.apache.org>                                                                                                                   |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |11/06/2007 11:49 AM                                                                                                                               |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |RE: Aegis databinding and Java 5 Generic List creating extra "anyType" field                                                                      |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|





The 'flat' feature is an attribute in the mapping schema that was
intended to control some cases of either adding an extra level of
type/element or not. Apparently, it isn't this one. While the code to
parse the attribute exists, the code to actually pay attention to it
does not.



________________________________

From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
Sent: Tuesday, November 06, 2007 11:27 AM
To: cxf-user@incubator.apache.org
Subject: RE: Aegis databinding and Java 5 Generic List creating extra
"anyType" field



Thanks for the reply. Unfortunately nillable is already set to false.

What is the 'flat' feature? I can't imagine that I'm the only person
having the problem.

Do you know if there is a way to specify something in an aegis.xml
config that tells the 'items' list to not add the 'anyType' property?

Regards,
Kaleb

Inactive hide details for "Benson Margulies" ---11/06/2007 08:58:14
AM---If you set nillable to false it might do what you want"Benson
Margulies" ---11/06/2007 08:58:14 AM---If you set nillable to false it
might do what you want. On the other


From:


"Benson Margulies" <bi...@basistech.com>


To:


<cx...@incubator.apache.org>


Date:


11/06/2007 08:58 AM


Subject:


RE: Aegis databinding and Java 5 Generic List creating extra "anyType"
field

________________________________




If you set nillable to false it might do what you want. On the other
hand, it might be that this is the never-implemented 'flat' feature of
Aegis.

> -----Original Message-----
> From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> Sent: Tuesday, November 06, 2007 8:55 AM
> To: cxf-user@incubator.apache.org
> Subject: Aegis databinding and Java 5 Generic List creating extra
> "anyType" field
>
>
>
> Thanks to Aegis databinding I can specify the minOccurs on my
primitive
> fields so the WSDL contract doesn't force them to be required.
However,
> Aegis has introduced something else that I'm not familiar with. It may
be
> "proper" but I'm not familiar with it and it seems to add one more
level
> of
> a property between a field name and it's value.
>
> I have an object defined as such:
>
> class ServiceListResult<T> {
>     private List<T> items;
>     //getters/setters
> }
>
> T is a Java 5 generic class reference.
>
> When using the Simple Server default data binding my object looked
like
> this when output from PHP:
>
> [items] => Array
>     (
>         [0] => stdClass Object
>             (
>                 ...
>             )
>      )
>
> Now it looks like this:
>
> [items] => sdtClass Object
>     (
>         [anyType] => Array
>             (
>                 [0] => stdClass Object
>                     (
>                         ...
>                     )
>             )
>      )
>
>
> Is there any way to make the output look like the Simple Server did or
is
> this the "proper" output since I'm using generics?
>
> Regards,
> Kaleb


RE: Aegis databinding and Java 5 Generic List creating extra "anyType" field

Posted by Benson Margulies <bi...@basistech.com>.
The 'flat' feature is an attribute in the mapping schema that was
intended to control some cases of either adding an extra level of
type/element or not. Apparently, it isn't this one. While the code to
parse the attribute exists, the code to actually pay attention to it
does not.

 

________________________________

From: Kaleb Walton [mailto:kdwalton@us.ibm.com] 
Sent: Tuesday, November 06, 2007 11:27 AM
To: cxf-user@incubator.apache.org
Subject: RE: Aegis databinding and Java 5 Generic List creating extra
"anyType" field

 

Thanks for the reply. Unfortunately nillable is already set to false.

What is the 'flat' feature? I can't imagine that I'm the only person
having the problem.

Do you know if there is a way to specify something in an aegis.xml
config that tells the 'items' list to not add the 'anyType' property?

Regards,
Kaleb

Inactive hide details for "Benson Margulies" ---11/06/2007 08:58:14
AM---If you set nillable to false it might do what you want"Benson
Margulies" ---11/06/2007 08:58:14 AM---If you set nillable to false it
might do what you want. On the other


From:


"Benson Margulies" <bi...@basistech.com>


To:


<cx...@incubator.apache.org>


Date:


11/06/2007 08:58 AM


Subject:


RE: Aegis databinding and Java 5 Generic List creating extra "anyType"
field

________________________________




If you set nillable to false it might do what you want. On the other
hand, it might be that this is the never-implemented 'flat' feature of
Aegis.

> -----Original Message-----
> From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> Sent: Tuesday, November 06, 2007 8:55 AM
> To: cxf-user@incubator.apache.org
> Subject: Aegis databinding and Java 5 Generic List creating extra
> "anyType" field
> 
> 
> 
> Thanks to Aegis databinding I can specify the minOccurs on my
primitive
> fields so the WSDL contract doesn't force them to be required.
However,
> Aegis has introduced something else that I'm not familiar with. It may
be
> "proper" but I'm not familiar with it and it seems to add one more
level
> of
> a property between a field name and it's value.
> 
> I have an object defined as such:
> 
> class ServiceListResult<T> {
>     private List<T> items;
>     //getters/setters
> }
> 
> T is a Java 5 generic class reference.
> 
> When using the Simple Server default data binding my object looked
like
> this when output from PHP:
> 
> [items] => Array
>     (
>         [0] => stdClass Object
>             (
>                 ...
>             )
>      )
> 
> Now it looks like this:
> 
> [items] => sdtClass Object
>     (
>         [anyType] => Array
>             (
>                 [0] => stdClass Object
>                     (
>                         ...
>                     )
>             )
>      )
> 
> 
> Is there any way to make the output look like the Simple Server did or
is
> this the "proper" output since I'm using generics?
> 
> Regards,
> Kaleb


RE: Aegis databinding and Java 5 Generic List creating extra "anyType" field

Posted by Kaleb Walton <kd...@us.ibm.com>.
Thanks for the reply. Unfortunately nillable is already set to false.

What is the 'flat' feature? I can't imagine that I'm the only person having
the problem.

Do you know if there is a way to specify something in an aegis.xml config
that tells the 'items' list to not add the 'anyType' property?

Regards,
Kaleb


|------------>
| From:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |"Benson Margulies" <bi...@basistech.com>                                                                                                        |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |<cx...@incubator.apache.org>                                                                                                                   |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |11/06/2007 08:58 AM                                                                                                                               |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |RE: Aegis databinding and Java 5 Generic List creating extra "anyType" field                                                                      |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|





If you set nillable to false it might do what you want. On the other
hand, it might be that this is the never-implemented 'flat' feature of
Aegis.

> -----Original Message-----
> From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> Sent: Tuesday, November 06, 2007 8:55 AM
> To: cxf-user@incubator.apache.org
> Subject: Aegis databinding and Java 5 Generic List creating extra
> "anyType" field
>
>
>
> Thanks to Aegis databinding I can specify the minOccurs on my
primitive
> fields so the WSDL contract doesn't force them to be required.
However,
> Aegis has introduced something else that I'm not familiar with. It may
be
> "proper" but I'm not familiar with it and it seems to add one more
level
> of
> a property between a field name and it's value.
>
> I have an object defined as such:
>
> class ServiceListResult<T> {
>     private List<T> items;
>     //getters/setters
> }
>
> T is a Java 5 generic class reference.
>
> When using the Simple Server default data binding my object looked
like
> this when output from PHP:
>
> [items] => Array
>     (
>         [0] => stdClass Object
>             (
>                 ...
>             )
>      )
>
> Now it looks like this:
>
> [items] => sdtClass Object
>     (
>         [anyType] => Array
>             (
>                 [0] => stdClass Object
>                     (
>                         ...
>                     )
>             )
>      )
>
>
> Is there any way to make the output look like the Simple Server did or
is
> this the "proper" output since I'm using generics?
>
> Regards,
> Kaleb

RE: Aegis databinding and Java 5 Generic List creating extra "anyType" field

Posted by Benson Margulies <bi...@basistech.com>.
If you set nillable to false it might do what you want. On the other
hand, it might be that this is the never-implemented 'flat' feature of
Aegis.

> -----Original Message-----
> From: Kaleb Walton [mailto:kdwalton@us.ibm.com]
> Sent: Tuesday, November 06, 2007 8:55 AM
> To: cxf-user@incubator.apache.org
> Subject: Aegis databinding and Java 5 Generic List creating extra
> "anyType" field
> 
> 
> 
> Thanks to Aegis databinding I can specify the minOccurs on my
primitive
> fields so the WSDL contract doesn't force them to be required.
However,
> Aegis has introduced something else that I'm not familiar with. It may
be
> "proper" but I'm not familiar with it and it seems to add one more
level
> of
> a property between a field name and it's value.
> 
> I have an object defined as such:
> 
> class ServiceListResult<T> {
>     private List<T> items;
>     //getters/setters
> }
> 
> T is a Java 5 generic class reference.
> 
> When using the Simple Server default data binding my object looked
like
> this when output from PHP:
> 
> [items] => Array
>     (
>         [0] => stdClass Object
>             (
>                 ...
>             )
>      )
> 
> Now it looks like this:
> 
> [items] => sdtClass Object
>     (
>         [anyType] => Array
>             (
>                 [0] => stdClass Object
>                     (
>                         ...
>                     )
>             )
>      )
> 
> 
> Is there any way to make the output look like the Simple Server did or
is
> this the "proper" output since I'm using generics?
> 
> Regards,
> Kaleb