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 babloosony <ba...@gmail.com> on 2005/03/01 13:02:23 UTC

why Axis doesn't preserve Inheritance ?

Hi All,

I am using AXIS 1.2 RC2 and trying to expose an EJB as web service
with below wsdl which is somewhat handcrafted  to support java
collections using my custom AXIS (De)Serialzers.

---------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:impl="http://ws.sosnoski.com/wsdl/wroxaxis/appendixb"
xmlns:intf="http://ws.sosnoski.com/wsdl/wroxaxis/appendixb"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns1="http://ws.sosnoski.com/schemas/wroxaxis/appendixb"
targetNamespace="http://ws.sosnoski.com/wsdl/wroxaxis/appendixb">
	<wsdl:types>
		<schema targetNamespace="http://ws.sosnoski.com/schemas/wroxaxis/appendixb"
elementFormDefault="qualified"
xmlns:tns="http://ws.sosnoski.com/schemas/wroxaxis/appendixb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/2001/XMLSchema">

			<complexType name="parentForecast">
				<sequence>
					<element name="parentZip" nillable="true" type="xsd:string" /> 
				</sequence>
			</complexType>
			
			<!-- Created from mapping for class wroxaxis.appendixb.Forecast -->
			<element name="forecast">
				<complexType>
					<extension base="tns1:parentForecast">
						<sequence>
							<element minOccurs="0" name="zip" type="xsd:string"/>
							<element minOccurs="0" name="city" type="xsd:string"/>
							<element minOccurs="0" name="state" type="xsd:string"/>
							<element minOccurs="0" name="date" type="xsd:string"/>
							<element minOccurs="0" name="forecast" type="xsd:string"/>
							<element name="temp" minOccurs="0">
								<complexType>
									<sequence>
										<element minOccurs="0" name="temp" type="xsd:string"/>
									</sequence>
								</complexType>
							</element>
							<element minOccurs="0" maxOccurs="unbounded" name="dummyVector"
type="xsd:string"/>
						</sequence>
						<attribute use="required" name="hi" type="xsd:byte"/>
						<attribute use="required" name="low" type="xsd:byte"/>
						<attribute use="required" name="precip" type="xsd:byte"/>
					</extension>
				</complexType>
			</element>

		</schema>
		<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://ws.sosnoski.com/wsdl/wroxaxis/appendixb"
elementFormDefault="qualified">
			<import namespace="http://ws.sosnoski.com/schemas/wroxaxis/appendixb"/>
			<element name="getWeather">
				<complexType>
					<sequence>
						<element name="ziprq" type="xsd:string"/>
					</sequence>
				</complexType>
			</element>
			<element name="getWeatherResponse">
				<complexType>
					<sequence>
						<element ref="tns1:forecast"/>
					</sequence>
				</complexType>
			</element>
		</schema>
	</wsdl:types>
	<wsdl:message name="getWeatherRequest">
		<wsdl:part name="parameters" element="impl:getWeather"/>
	</wsdl:message>
	<wsdl:message name="getWeatherResponse">
		<wsdl:part name="parameters" element="impl:getWeatherResponse"/>
	</wsdl:message>
	<wsdl:portType name="SparePartPriceSessionInterface">
		<wsdl:operation name="getWeather">
			<wsdl:input name="getWeatherRequest" message="impl:getWeatherRequest"/>
			<wsdl:output name="getWeatherResponse" message="impl:getWeatherResponse"/>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="SparePartPriceSessionBinding"
type="impl:SparePartPriceSessionInterface">
		<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="getWeather">
			<wsdlsoap:operation/>
			<wsdl:input>
				<wsdlsoap:body use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<wsdlsoap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="SparePartPriceSessionInterfaceService">
		<wsdl:port name="SparePartPriceSessionBean"
binding="impl:SparePartPriceSessionBinding">
			<wsdlsoap:address
location="http://localhost:9999/axis/services/SparePartPriceSession"/>
		</wsdl:port>
	</wsdl:service>
	<!--WSDL created by Apache Axis version: 1.2RC2 Built on Nov 16, 2004
(12:19:44 EST)-->
</wsdl:definitions>
---------------------------------------------------------------------------------------------------------



I have 2 questions here now.

1. Even though the above WSDL is "validated ok" by WSAD'S WSDL
Validator, Altova's XMLSpy say it is invalid and reports an error
"Unexpected element 'extension' in element 'complexType'. Can anyone
please tell me why is this error occurring ?        Is my WSDL correct
?


2. I have taken the above WSDL and feeded to axis to generate stubs
but AXIS does not preserve inheritance among  Forecast class and its
super class ParentForecast class. The Forecast java file does not
extend ParentForecast class.  Why is this strange behavior from AXIS's
WSDL2Java Code Generator ?





Thanks & Regards,
Kumar.