axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amila Suriarachchi" <amilasuriarach...@gmail.com>
Subject Unwrapping and backwordcompatibility support in codegen
Date Fri, 23 Feb 2007 10:35:45 GMT
1. Unwrapping support (-uw)
The Response unwrapping functionality was added to axis2 codegen recently.
with this support now axis2 codegen fully supports the unwrapping.
For an example lets take the following schema.
         <xsd:element name="Request1">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="param1" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="Response1">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="param1" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>

suppose Request1 and Response1 are corresponding to Request and Response
messages. In this case wrapped (normal) method signature would be.

public org.example.www.wsdltest.Response1 Operation1(
org.example.www.wsdltest.Request1 request1);

But after unwrapping it would be
public java.lang.String Operation1(java.lang.String param1);

Response unwrapping is done only if it contains one child element.
For an example Lets take another schema.
<xsd:element name="Request2">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="param1" type="xsd:string"/>
                        <xsd:element name="param2" type="xsd:string"/>
                        <xsd:element name="param3" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="Response2">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="param1" type="xsd:int"/>
                        <xsd:element name="param2" type="xsd:boolean"/>
                        <xsd:element name="param3" type="xsd:float"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
For above the unwrapped method signature would be,
public org.example.www.wsdltest.Response2 Operation2(java.lang.Stringparam11,
java.lang.String param2, java.lang.String param3);

Only the Request unwrapped.

On the other hand if there is an immediate Complex type Response is
unwrapped either up to complex type or to single element.

Eg.
<xsd:element name="Request3" type="tns:SingleElementComplexType"/>
            <xsd:element name="Response3"
type="tns:SingleElementComplexType"/>

            <xsd:complexType name="SingleElementComplexType">
                <xsd:sequence>
                    <xsd:element name="param1" type="xsd:string"/>
                </xsd:sequence>
            </xsd:complexType>
unwrapped method signature is
public java.lang.String Operation3(java.lang.String param12);

and for following schema counting more elements,
<xsd:element name="Request4" type="tns:MultipleElementComplexType"/>
            <xsd:element name="Response4"
type="tns:MultipleElementComplexType"/>

            <xsd:complexType name="MultipleElementComplexType">
                <xsd:sequence>
                    <xsd:element name="param1" type="xsd:string"/>
                    <xsd:element name="param2" type="xsd:string"/>
                    <xsd:element name="param3" type="xsd:string"/>
                </xsd:sequence>
            </xsd:complexType>

public MultipleElementComplexType Operation4(String param14, String param25,
String param36);

2. backwordcompatibility support (-b)
Axis have a different interface method signature than normally generated
Axis2 wrapped code. Most of the time it unwraps the Messages to next level
ComplexType. So -b option can be used to generate a similar method signature
as in axis with the axis2. This option would make it easier to the people
who wants to migrates to axis2 from axis with there existing web services.









-- 
Amila Suriarachchi,
WSO2 Inc.

Mime
View raw message