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 "Kasi, Anand" <An...@sabre-holdings.com> on 2007/08/15 23:04:41 UTC

JAVA2WSDL generating invalid proxy

Hello everyone, 

Has anyone had any trouble generating proxies with JAVA2WSDL when the
schemas had base and extensions in them? The java files get generated
but they are invalid and cannot be compiled. Axis seems to handle
inheritance hierarchy incorrectly anytime you have extensions defined in
the schemas.
For example, CountryCodeType in the wsdl below generates incorrectly. 

<complexType name="CountryNameType">
				<simpleContent>
					<extension
base="tns1:StringLength0to64">
						<attribute name="Code"
type="tns1:ISO3166" use="optional">
			            </attribute>
					</extension>
				</simpleContent>
			</complexType>
			<simpleType name="StringLength0to64">
				<restriction base="xsd:string">
					<minLength value="0"/>
					<maxLength value="64"/>
				</restriction>
			</simpleType>
			<simpleType name="ISO3166">
				<restriction base="xsd:string">
					<pattern value="[a-zA-Z]{2}"/>
				</restriction>
			</simpleType>
		</schema>


 I am not able to generate the proxy with Axis 1.3 and 1.4, but it works
fine with Jax ws and also .NET. 

Below is the complete wsdl file. Any workarounds or any insight into the
problem will help greatly. 

	<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://webservices.sabre.com/cruise"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://webservices.sabre.com/cruise"
xmlns:intf="http://webservices.sabre.com/cruise"
xmlns:tns1="urn:sailingavailability:datatypes:communications:cruise:sabr
e:com" xmlns:tns2="urn:datatypes:communications:cruise:sabre:com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<wsdl:types>
		<schema elementFormDefault="qualified"
targetNamespace="http://webservices.sabre.com/cruise"
xmlns="http://www.w3.org/2001/XMLSchema">
			<element name="SailingAvailability">
				<complexType>
					<sequence>
						<element name="in0"
type="tns1:SailingAvailabilityRequest"/>
					</sequence>
				</complexType>
			</element>
			<element name="SailingAvailabilityResponse">
				<complexType>
					<sequence>
						<element
name="SailingAvailabilityReturn"
type="tns1:SailingAvailabilityResponse"/>
					</sequence>
				</complexType>
			</element>
		</schema>
		<schema elementFormDefault="qualified"
targetNamespace="urn:sailingavailability:datatypes:communications:cruise
:sabre:com" xmlns="http://www.w3.org/2001/XMLSchema">
			<complexType name="SailingAvailabilityRequest">
				<sequence>
					<element name="reqString"
type="xsd:string"/>
				</sequence>
			</complexType>
			<complexType name="SailingAvailabilityResponse">
				<sequence>
					<element name="reqString"
type="xsd:string"/>
					<element minOccurs="0"
name="CountryName" type="tns1:CountryNameType"/>
				</sequence>
			</complexType>
			<complexType name="CountryNameType">
				<simpleContent>
					<extension
base="tns1:StringLength0to64">
						<attribute name="Code"
type="tns1:ISO3166" use="optional">
			            </attribute>
					</extension>
				</simpleContent>
			</complexType>
			<simpleType name="StringLength0to64">
				<restriction base="xsd:string">
					<minLength value="0"/>
					<maxLength value="64"/>
				</restriction>
			</simpleType>
			<simpleType name="ISO3166">
				<restriction base="xsd:string">
					<pattern value="[a-zA-Z]{2}"/>
				</restriction>
			</simpleType>
		</schema>
	</wsdl:types>
	<wsdl:message name="SailingAvailabilityRequest">
		<wsdl:part element="impl:SailingAvailability"
name="parameters"/>
	</wsdl:message>
	<wsdl:message name="SailingAvailabilityResponse">
		<wsdl:part element="impl:SailingAvailabilityResponse"
name="parameters"/>
	</wsdl:message>
	<wsdl:portType name="CruiseCommunicationAPI">
		<wsdl:operation name="SailingAvailability">
			<wsdl:input
message="impl:SailingAvailabilityRequest"
name="SailingAvailabilityRequest"/>
			<wsdl:output
message="impl:SailingAvailabilityResponse"
name="SailingAvailabilityResponse"/>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="CruiseAPISoapBinding"
type="impl:CruiseCommunicationAPI">
		<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="SailingAvailability">
			<wsdlsoap:operation soapAction=""/>
			<wsdl:input name="SailingAvailabilityRequest">
				<wsdlsoap:body use="literal"/>
			</wsdl:input>
			<wsdl:output name="SailingAvailabilityResponse">
				<wsdlsoap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="CruiseCommunicationAPIService">
		<wsdl:port binding="impl:CruiseAPISoapBinding"
name="CruiseAPI">
			<wsdlsoap:address
location="http://10.19.65.152:3008/SailAvail/services/CruiseAPI"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>

Thanks,
Anand