axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon McClenahan" <simon.mcclena...@stellent.com>
Subject XSLT for Axis WSDL hacking
Date Fri, 17 May 2002 20:51:49 GMT
I would like to share with you the XSL file I ended up creating to hack a WSDL generated by
gSOAP so that Axis' WSDL2Java could process it with modifications correctly. It replaces "unsignedInt"
with "int", "duration" with "string" and changes derivation from anyType from restriction
to extension. Feel free to add more features to this or make it "cleaner" (like getting rid
of the hard-coded namespace prefix "xsd").

I use this XSL in an Ant style task to generate the WSDL for use by Axis.

	<target name="genaxiswsdl">
		<delete file="${axiswsdl}" />
		<style in="${gsoapwsdl}" out="${axiswsdl}" style="${axis.dir}/translateAxis.xsl" />
	</target>

cheers,
	Simon


> -----Original Message-----
> From: Simon McClenahan 
> Sent: Friday, May 10, 2002 2:01 PM
> To: Axis User (E-mail)
> Subject: XSLT help
> 
> 
> I have a WSDL (generated by gSOAP) that I need to slightly 
> modify before it will work with the current version of Axis' 
> WSDL2Java. What is the XSL look like to perform the following 
> transformation? I am using the <style> Ant task to perform 
> the transformation when doing a build of my client.
> 
> Transform all references to unsupported Schema unsigned types 
> to regular types supported by Axis/JAXRPC.
> Change Schema complexType derivation from restriction to 
> extension when the base is anyType.
> 
> Some examples:
> 
> Translate xsd:unsignedInt to xsd:int, and xsd:duration to xsd:string
> 
>   <complexType name="PoolInfo">
>    <all>
>     <element name="size" type="xsd:unsignedInt" minOccurs="0" 
> maxOccurs="1"/>
>     <element name="agentTimeout" type="xsd:duration" 
> minOccurs="0" maxOccurs="1" nillable="true"/>
>    </all>
>   </complexType>
> 
> to
> 
>   <complexType name="PoolInfo">
>    <all>
>     <element name="size" type="xsd:int" minOccurs="0" maxOccurs="1"/>
>     <element name="agentTimeout" type="xsd:string" 
> minOccurs="0" maxOccurs="1" nillable="true"/>
>    </all>
>   </complexType>
> 
> 
> 
> Translate derivation with base of anyType from restriction to 
> extension.
> 
>   <complexType name="IOSpec">
>    <complexContent>
>     <restriction base="xsd:anyType">
>      <sequence>
>       <element name="spec" type="ts:stringData" minOccurs="0" 
> maxOccurs="1"/>
>       <element name="specType" type="xsd:string" 
> minOccurs="0" maxOccurs="1" nillable="true"/>
>      </sequence>
>     </restriction>
>    </complexContent>
>   </complexType>
> 
> to
> 
>   <complexType name="IOSpec">
>    <complexContent>
>     <extension base="xsd:anyType">
>      <sequence>
>       <element name="spec" type="ts:stringData" minOccurs="0" 
> maxOccurs="1"/>
>       <element name="specType" type="xsd:string" 
> minOccurs="0" maxOccurs="1" nillable="true"/>
>      </sequence>
>     </extension>
>    </complexContent>
>   </complexType>
> 

Mime
View raw message