axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wei Hsu <w...@openharbor.com>
Subject RE: Doc/Lit Wrapped and xml attributes
Date Tue, 29 Jun 2004 17:57:23 GMT
<quote>
No, on the top level element this is explicitly checked in the code - if
there are attributes, it isn't wrapped.
</quote>

When you say top level element, I am assuming you mean the elements
explicitly used as wsdl:part to wsdl:message right?  If you mean to tell me
that AXIS checks all top level elements declared within a xsd:schema
declaration, then Doc/Lit Wrapped really has some serious limitations...

<quote>
If there are attributes in the schema of a wrapped parameter (or sub part of
a parameter), those attributes get rolled into the generated Java type as
fields just like they do for non-wrapped doc/lit.....  I believe this all
works fine, so what's the concern?
</quote>

The concern is the possibility that Doc/Lit Wrapped really SHOULD NOT
support that behavior.  Anne Thomas Manes, who is very knowledgeable and
helpful, seems to believe so.  While AXIS currently supports this, I don't
want my service that sends parameter elements that contain attributes to
just stop working with future releases.  Having read (parts of) the specs
for JAX-RPC, I am lead to believe that the no-attribute restriction appears
that it should only affect the "wrapper" element itself.  I just wanted to
see how the AXIS developers go about resolving uncertain issues (at least to
this user). 

- Wei

-----Original Message-----
From: Glen Daniels [mailto:glen@thoughtcraft.com] 
Sent: Tuesday, June 29, 2004 7:41 AM
To: axis-dev@ws.apache.org
Subject: RE: Doc/Lit Wrapped and xml attributes


Hi Tom, all:

> No, on the top level element this is explicitly checked in 
> the code - if there are attributes, it isn't wrapped.

Yup.

> The sub-elements are each a parameter to the operation, so 
> there isn't any room for attributes there either.

Nope.  Attributes there are fine, because they're just a part of the schema
type (and Java type) for that parameter. 

> You *could* get an attribute in the WSDL for an operation 
> parameter by using a JavaBean that WSDL2Java has created that 
> has the right meta data to tell Axis that a property of the 
> Bean is supposed to be an attribute...  Ick.

Why "ick"?  This seems perfectly reasonable to me.  If there are attributes
in the schema of a wrapped parameter (or sub part of a parameter), those
attributes get rolled into the generated Java type as fields just like they
do for non-wrapped doc/lit.....  I believe this all works fine, so what's
the concern?

--Glen

> ________________________________________
> From: Wei Hsu [mailto:whsu@openharbor.com]
> Sent: Monday, June 28, 2004 5:23 PM
> To: 'axis-dev@ws.apache.org'
> Subject: Doc/Lit Wrapped and xml attributes
> 
> Hi all,
>  
> There were some discussions on the axis-user list about 
> whether Doc/Lit Wrapped style can actually use xml 
> attributes.  I was wondering what you guys think.
>  
> -Wei
>  
> -----Original Message-----
> From: Wei Hsu [mailto:whsu@openharbor.com]
> Sent: Monday, June 28, 2004 2:15 PM
> To: 'axis-user@ws.apache.org'
> Subject: RE: BeanSerializer and xml attributes
>  
> Hi Anne,
>  
> Thanks for the quick response.  Based on your response, I 
> decided to take a look through both JAX-RPC 1.1 and JAX-RPC 
> 2.0 specs.  I found the following exerpts on "wrapper" style 
> from each specs:
>  
> <exerpt-JAX-RPC-1.1>
> 6.4.1
> In order to qualify as using the "wrapper" style, an 
> operation must fulfill the following conditions:
> - its input and output messages (if present) must contain 
> exactly one part
> - such a part must refer to an element named after the operation
> - such an element (a wrapper) must be of a complex type 
> defined using the xsd:sequence compositor and containing only 
> elements declarations </exerpt-JAX-RPC-1.1>
>  
> Here for JAX-RPC 1.1, I interpreted the third part as a 
> restriction on the structure of the wrapper itself, not the 
> structure of elements that make up of the wrapper.  What do you think?
>  
> <exerpt-JAX-RPC-2.0>
> 2.3.1.2 Wrapper Style
> A WSDL operation qualifies for wrapper style mapping only if 
> the following criteria are met:
> (i) The operation's input and output messages each contain 
> only a single part
> (ii) The input message part refers to a global element 
> declaration whose localname is equal to the operation name
> (iii) The output message part refers to a global element declaration
> (iv) The elements referred to by the input and output message 
> parts (henceforth referred to as wrapper elements) are both 
> complext types defined using the xsd:sequence compositor
> (v) The wrapper elements only contain child elements, they 
> must not contain other structures such as xsd:choice, 
> substitution groups or attributes </exerpt-JAX-RPC-2.0>
>  
> Once again, it wasn't clear to me whether (v) is meant as a 
> restriction on the structure of the wrapper elements or that 
> of elements that the wrapper points to.   Are there any other 
> reasons why you think Doc/Lit Wrapped can't handle elements 
> with attributes?  It just doesn't make sense in my mind for 
> WSDL to use XML Schema as the base language, and yet remove 
> such a powerful feature (attributes).  I'm confused...
>  
> -Wei
>  
> PS:  FWIW, both AXIS (1.2 beta) and .NET (.NET WebService 
> Studio 1.0) were able to pass WS-I compliance test (using 
> SOAPScope) and successfully generate and send the following 
> elements that use attributes:
>  
> <element name="createStuff">
>   <complexType>
>     <sequence>
>       <element name="CreatorStuff" type="tns1:CreatorStuff"/>
>     </sequence>
>   </complexType>
> </element>
>  
> <element name="createStuffResponse">
>   <complexType/>
> </element>
>  
> <complexType name="CreatorStuffBase">
>   <sequence>
>     <element name="propStr1" nillable="true" type="xsd:string"/>
>     <element name="propInt1" type="xsd:int"/>
>   </sequence>
> </complexType>
>  
> <complexType name="CreatorStuff">
>   <complexContent>
>     <extension base="tns1:CreatorStuffBase">
>       <attribute name="propStr2" type="xsd:string"/>
>     </extension>
>   </complexContent>
> </complexType>
>  
>  
>  
>  
>  
>  
> -----Original Message-----
> From: Anne Thomas Manes [mailto:anne@manes.net]
> Sent: Monday, June 28, 2004 1:01 PM
> To: axis-user@ws.apache.org
> Subject: RE: BeanSerializer and xml attributes
>  
> Per the definition of "wrapped" in JAX-RPC (and in the way 
> .NET works), wrapped does not support attributes - only a 
> sequence of elements.
>  
> ________________________________________
> From: Wei Hsu [mailto:whsu@openharbor.com]
> Sent: Monday, June 28, 2004 11:56 AM
> To: axis-user@ws.apache.org
> Subject: BeanSerializer and xml attributes
>  
> Hi all,
>  
> I was wondering if anyone knows whether axis's BeanSerializer 
> actually supports xml attributes.  Currently when I try to 
> send a doc/lit wrapped message with the following xml element:
>  
> <createStuff>
>   <Stuff propStr2="b">
>     <propStr1>a</propStr1>
>     <propInt1>2</propInt1>
>   </Stuff>
> </createStuff>
>  
> The BeanSerializer always ignores the attribute "propStr2" 
> and calls createStuff("a", 2, null).  It seems somewhat 
> intuitive that the BeanSerializer should be configurable to 
> take the attribute and use the corresponding getters/setters 
> on the server side.  Is there any reason why that's not the 
> case right now?  Do I have to create my own 
> serializer/deserializer if I want to use XML attributes?   I 
> would really appreciate any info or help.  Thanks!
>  
> -Wei
> 
> 

Mime
View raw message