Il giorno mer, 21/12/2005 alle 17.39 -0500, Anne Thomas Manes ha
scritto:
> If you want ArrayOfCodes to contain CodeImpl rather than Code, then
> you must define the type that way:
> 
> <xsd:complexType name="ArrayOfCodes">
> <xsd:sequence>
>   <xsd:element maxOccurs="unbounded" minOccurs="0" name="code"
> type="pub:CodeImpl"/>
> </xsd:sequence>
> </xsd:complexType>
> 
> Otherwise, if you define the inner type as Code and you return
> CodeImpl, the client should generate an error that it found an
> unexpected type.. 
> 
> But that doesn't explain why your service doesn't return a SOAP
> envelope. I suggets you run wsdl2java and compare the skeleton code.
> 
Mmmhh... I already used this approach to define a type Exp (marker
interface) with subtypes And, Or etc... I had a type Query made of
elements of type Exp and I didn't find any problem handling them. Since
I want to use the same interface to handle different types of Codes
(with different structure) I think this is correct.

Anyway I tried to do a wsdl2java. Generated code is similar to mine,
except for the fact that it doesn't create an empty interface for Code
and it defines the operation in this way:

<operation name="list" qname="pub:list" returnQName="codes"
returnType="pub:ArrayOfCodes" returnItemQName="pub:code"
soapAction="http://example.com/service#list"; />

I tried to add the returnItemQName in my descriptor but the result is
the same :-(

Regards,
Davide Romanini


Reply via email to