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 Simon Gibbs <si...@cantorva.com> on 2007/08/31 22:52:13 UTC

AXIS-2095 / AXIS-2250 array item element QName doesn't match generated schema - workaround?

Hi Guys

First post and new to the list so apologies in advance for any breach of
ettiquette.

I have run into what looks like bug AXIS-2095 / AXIS-2250 but I'll
briefly describe the problem below. I'm just looking for a work around
really.

I have a service generated from an Eclipse Europa wizard and the
following array type mapping:

<arrayMapping innerType="ns7:OutletDescription"
languageSpecificType="java:com.domain.ns.OutletDescription[]"
qname="ns7:ArrayOfOutletDescription" xmlns:ns7="http://ns.domain.com"/>

Which results in the following schema elements:

<complexType name="ArrayOfOutletDescription">
  <sequence>
    <element maxOccurs="unbounded" minOccurs="0" name="item" type="impl:OutletDescription"/>
  </sequence>
</complexType>

<complexType name="OutletDescription">
 <sequence>
   <element name="ID" nillable="true" type="xsd:string"/>
   <element name="name" nillable="true" type="xsd:string"/>
   <element name="type" nillable="true" type="impl:OutletType"/>
 </sequence>
</complexType>


but the following output in the response (copied from SOAP UI window and
edited):

            <outletDescriptions>
               <outletDescriptions>
                  <ID>1</ID>
                  <name>Outlet 1</name>
                  <type>smallOutlet</type>
               </outletDescriptions>
               <outletDescriptions>
                  <ID>2</ID>
                  <name>Mega Outlet</name>
                  <type>bigOutlet</type>
               </outletDescriptions>
            </outletDescriptions>

Schema validation fails on each instance of the inner outletDescriptions
element since the schema specifies "item" as the element name.

ArrayOfOutletDescription is not the top most type in the response but is
used by a property of the top level type. Here "top level" means the
Java type returned by my Java implementation of the method. I noticed
the generated schema contains a MethodNameResponse class that wraps the
whole thing as well, but this does not appear to be material.

Narayan Singh Dhillon's work around as mentioned on AXIS-2250 seems only
to apply when the top level type is an array.

https://issues.apache.org/jira/browse/AXIS-2250
https://issues.apache.org/jira/browse/AXIS-2095

Any work around greatly appreciated. I'd also be grateful for a fixed
binary, but I can see the bug is raised an will be worked on eventually.

Simon




Re: AXIS-2095 / AXIS-2250 array item element QName doesn't match generated schema - workaround?

Posted by Simon Gibbs <si...@cantorva.com>.
Simon Gibbs wrote:
> Hi Guys
>
> First post and new to the list so apologies in advance for any breach of
> ettiquette.
>
> I have run into what looks like bug AXIS-2095 / AXIS-2250 but I'll
> briefly describe the problem below. I'm just looking for a work around
> really.
>   
I was able to fix the code myself and have documented the code change here:

https://issues.apache.org/jira/browse/AXIS-2095#action_12524314

I quit all claims to the copyright on that contribution on behalf of
myself and Cantorva Limited.

A question, does Axis (as opposed to the Axis2 rewrite) still have an
active development and user community?  This bug was very old and quite
shallow so I feel as if very few eyes are passing over this code base now?

Simon Gibbs
Director, Cantorva Limited