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 Ajay Kumar Gour <aj...@s7solutions.com> on 2007/09/10 10:36:47 UTC
Polymorphism sample using XML..
Hello All,
Please share if somebody has polymorphism sample using XML Beans data
binding.
Thanks,
-Ajay
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Polymorphism sample using XML..
Posted by Amila Suriarachchi <am...@gmail.com>.
here is an example I used
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://localhost/wsdlfile/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl"
name="wsdlfile"
targetNamespace="http://localhost/wsdlfile/">
<wsdl:types>
<xsd:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://localhost/wsdlfile/">
<xsd:element name="Get" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="test" type="tns:GetType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="GetType">
<xsd:sequence>
<xsd:element name="in" type="xsd:string"/>
<xsd:element name="type"
type="tns:Type_T"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ChildGetType">
<xsd:complexContent>
<xsd:extension base="tns:GetType">
<xsd:sequence>
<xsd:element name="test" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="GetResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:string"/>
<xsd:element name="type"
type="tns:Type_T">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="Type_T">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="a"></xsd:enumeration>
<xsd:enumeration value="b"></xsd:enumeration>
<xsd:enumeration value="c"></xsd:enumeration>
<xsd:enumeration value="d"></xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="GetRequest">
<wsdl:part element="tns:Get" name="parameters"/>
</wsdl:message>
<wsdl:message name="GetResponse">
<wsdl:part element="tns:GetResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="wsdlfile">
<wsdl:operation name="Get" wsaw:Action="tns:GetLink">
<wsdl:input message="tns:GetRequest"/>
<wsdl:output message="tns:GetResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="wsdlfileSOAP" type="tns:wsdlfile">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Get">
<soap:operation
soapAction="http://localhost/wsdlfile/GetLink"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="wsdlfile">
<wsdl:port binding="tns:wsdlfileSOAP" name="wsdlfileSOAP">
<soap:address location="http://localhost/wsdlfile"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Please try with a Axis2 SNAPSHOT.
I used the following arguments -u -d xmlbeans -Ewdc -ss -sd -g to generate
the xmlbeans code seperately.
i.e I generated the xmlbeans code seperately and replace them.
Amila.
On 9/10/07, Ajay Kumar Gour <aj...@s7solutions.com> wrote:
>
> Hello All,
>
> Please share if somebody has polymorphism sample using XML Beans data
> binding.
>
> Thanks,
> -Ajay
>
> ---------------------------------------------------------------------
> 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.