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 Melanie Courtot <co...@ebi.ac.uk> on 2006/11/08 17:29:44 UTC
WSDL2Java and xsd:element
Hi,
I'm trying to get Castor and Axis to work together and to generate the
java classes using wsdl2java. Everything looks fine at the moment, except
for a small thing.
I have a xml schema (the one I used previously to build my Castor
classes), and I want to use it in my wsdl.
To keep things simple at the moment I don't import that schema but just
copy it into my wsdl.
My question is is it possible to use an element (instead of a complexType)
defined in that schema as a return for one of my method.
my schema: (simplified)
<xsd:schema>
<xsd:complexType name="Sbontology">
<xsd:sequence>
<xsd:element name="Term" maxOccurs="unbounded" minOccurs="1">
.....
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
If I use (transforming element Term into complexType Term)
<xsd:complexType name="Term">
<xsd:sequence>
....
</xsd:sequence>
</xsd:complexType>
I can then use:
<wsdl:message name="getTermByIdResponse">
<wsdl:part name="getTermByIdReturn" type="tns:Term"/>
</wsdl:message>
(tns being my own namespace
http://127.0.0.1:9971/compneur-srv/sbo-perso/services/SBOWebServices)
I would like to use my original xsd and import it into the wsdl, but I
can't find information on how to use the element instead of the
complexType in the message.
I tried using
<wsdl:message name="getTermByIdResponse">
<wsdl:part name="getTermByIdReturn" element="tns:Term"/>
</wsdl:message>
with the original schema but I get an error
java.io.IOException: Element
{http://127.0.0.1:9971/compneur-srv/sbo-perso/services/SBOWebServices}Term
is referenced but not defined.
I've been trying to find info on the web, but I don't know if it is
because I have to use a complexType, or if my syntax is wrong or if it is
a namespace problem. (using "type" works, so I would say the namespace is
fine).
Thanks for any help,
Melanie
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org