You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Florian Lindauer <fl...@secure-net.de> on 2003/06/20 18:15:28 UTC

Axis+JWSDP / extended bean classes in WSDL / serializing

We found out that JWSDP (1.2) as a client does not work correctly
with our Axis-based WebService. It turns out that the problem
is with the response / complex types that Axis sends.
We have a data object (class) that holds some fields, and a
class that inherits from the first one and holds another field.
So, Axis generates the following XML-schema within the WSDL:

<complexType name="BaseClass">
  <sequence>
   <element name="code" type="xsd:int"/>
   <element name="message" nillable="true" type="xsd:string"/>
   <element name="success" type="xsd:boolean"/>
  </sequence>
</complexType>

<complexType name="SubClass">
  <complexContent>
   <extension base="impl:BaseClass">
    <sequence>
     <element name="device" nillable="true" type="impl:DeviceClass"/>
    </sequence>
   </extension>
  </complexContent>
</complexType>

As I understand it, sequence defines an order. And, in this case
of an extension, the order should be "first all of the base
class, then all of the subclass". I did not read that out of
the xml-schema-spec (seems you can get quite a headache from
this :), but found it here:
http://www.zvon.org/xxl/XMLSchemaTutorial/Output/ser_ext_patterns_st0.html

Anyways, while Axis as a client as well as .NET seem to be quite
permissive, Sun's JWSDP seems to act on the assumption of this
order.

But, Axis does not stick to this order, but it seems to
put the elements in the response-XML into alphabetic order:

  <multiRef id="id0" ...>
    <code xsi:type="xsd:int">1000</code>
    <device xsi:type="x:DeviceClass" xsi:nil="true"/>
    <message xsi:type="xsd:string">error</message>
    <success xsi:type="xsd:boolean">false</success>
  </multiRef>

JWSDP fails parsing!
So, this would be a bug in Axis, not JWSDP?

I just tried Axis-1.1 final, and it was the same.

Another question is, why Axis uses sequences to map bean classes
to WSDL/schema - wouldn't "all"-nodes be better, because they
do not impose an order on the elements?
(Forgive me if this is a stupid question..)
Yeah - just tested - if I replace all "sequence"s with "all"s in
the WSDL and feed it to JWSDP, it works perfectly OK :)

So - what should Axis do - use all-nodes in WSDL, or maintain
the right order according to the sequences?
Did not find anything in Bugzilla, but then I might just not
have used the right keywords..


Thanks for any comments.


-- 
Florian Lindauer