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 Wei Hsu <wh...@openharbor.com> on 2004/06/28 23:22:43 UTC

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