axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amila Suriarachchi" <amilasuriarach...@gmail.com>
Subject Re: XSD inheritance (via extension) in WSDLs (top-down)
Date Thu, 26 Jun 2008 04:49:01 GMT
On Thu, Jun 26, 2008 at 12:31 AM, Andrew Clegg <andrew.clegg@gmail.com>
wrote:

> Here's a question for the schema design gurus.
>
> I have a document/literal wrapped WSDL which defines an operation
> called SubmitBLAST. The corresponding element for the input message
> looks like this:
>
>        <xsd:element name="SubmitBlast">
>                <xsd:complexType>
>                        <xsd:sequence>
>                                <xsd:element name="query_data"
> type="AminoAcidSeqData" />
>                        </xsd:sequence>
>                </xsd:complexType>
>        </xsd:element>
>
> AminoAcidSeqData is, in turn, an abstract type:
>
>        <xsd:complexType abstract="true" name="AminoAcidSeqData" />
>
> which various concrete types extend, e.g.:
>
>        <xsd:complexType name="FastaRecord">
>                <xsd:complexContent>
>                        <xsd:extension base="AminoAcidSeqData">
>                                <xsd:sequence>
>                                        <xsd:element name="header"
> type="xsd:string" />
>                                        <xsd:element name="sequence"
> type="AminoAcidSeq" />
>                                </xsd:sequence>
>                        </xsd:extension>
>                </xsd:complexContent>
>        </xsd:complexType>
>
> This passes WS-I compliance, and I've generated my service with
> wsdl2java (using XMLBeans) with no problems. However, I've hit upon a
> snag in testing the WSDL with SoapUI. It autogenerates messages from
> the WSDL that look like this:
>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:typ="http://ws.cathdb.info/Types">
>   <soapenv:Header/>
>   <soapenv:Body>
>      <typ:SubmitBlast>
>         <typ:query_data/>
>      </typ:SubmitBlast>
>   </soapenv:Body>
> </soapenv:Envelope>
>
> So there's no skeleton generated for any of the possible
> instantiations of the abstractly-typed element query_data. And
> anything I put in there fails XML Beans validation on the server side,
> even if I know it matches the structure, with this error:
>
> Document invalid: [error: cvc-elt.2: Element
> 'T=AminoAcidSeqData@http://grid.cathdb.info/Types' is abstract and
> cannot be used in an instance]
>
> Am I barking up the wrong tree here, and expecting too much
> 'cleverness' from the code generators (in Axis2 or SoapUI)?
>
> Ideally I'd like to be able to send different messages for each of the
> concrete implementations of AminoAcidSeqData that are reconstructed on
> the server side into the appropriate objects. Is there a better way to
> do this?


Here your request should be something like this

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://ws.cathdb.info/Types">
  <soapenv:Header/>
  <soapenv:Body>
     <typ:SubmitBlast>
        <typ:query_data xsi:type="FastaRecord" >
               <header>tess</header>
               <Sequence></Sequence>
       </typ:query_data>
     </typ:SubmitBlast>
  </soapenv:Body>
</soapenv:Envelope>

Try to invoke this service ether using an XMLBean client or an ADB client.
Then you can get a proper request.

thanks,
Amila.


>
> Many thanks,
>
> Andrew.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Amila Suriarachchi,
WSO2 Inc.

Mime
View raw message