Axis2 WSDL2JAVA created skeleton does not alow multiple parts where one part is 
body and another destined for soap header
-------------------------------------------------------------------------------------------------------------------------

                 Key: AXIS2-2133
                 URL: https://issues.apache.org/jira/browse/AXIS2-2133
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: codegen
    Affects Versions: 1.1.1
         Environment: Windows XP - Java 5
            Reporter: Sarwar Raza


Here is what we were able to get working with Axis 1.4, and have been 
struggling with Axis 2...
Our input message contained TWO parts, one destined for the body, and the other 
destined for the header (we set this up in the binding).
The header contains security info that gets used by WSSJ - pretty typical usage 
best we can tell.

When we ran WSDL2Java using Axis 1.4, the resulting stubs resulted in a method 
signature for each of the methods that looked something like:

message (header, body).

Using Axis2, the WSDL does get parsed correctly (even though we have defined 
two parts for the input message), but the resulting method signature in the 
skeleton code always turns out like:

message(header) 

Note the body is absent, even though it was set up to be one of the two parts 
for the message.

Other than the fact that we need to pack our security tokens into the header, 
the WSDL is pretty basic. I can't rule out that transmogrifying the WSDL to 
work with Axis 2 has led to some errors creeping in - at this point, we've been 
staring at it for quite a while and can't see what we may be doing wrong. I'm 
attaching the WSDL here - perhaps someone can eyeball a problem we've missed. 
Note the header/body setup in the binding - we construct the binding by hand - 
is there any way to annotate a message part as being destined for the header so 
that we could use Eclipse WTP to generate the binding automagically?

We have tried the unwrap and backwards compatibility flags also to no avail.

WSDL below:

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
    xmlns:wss="http://ws.test.sample.com/WSSecurity/"; 
    xmlns:tns="http://ws.test.sample.com/TestService/"; 
    name="TestService"
    targetNamespace="http://ws.test.sample.com/TestService/";>

    <wsdl:types>
        <schema
            elementFormDefault="qualified"
            xmlns="http://www.w3.org/2001/XMLSchema";
            xmlns:apachesoap="http://xml.apache.org/xml-soap";
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
            targetNamespace="http://ws.test.sample.com/TestService/";>

            <!-- Security Header types -->

            <element name="SecurityType">
                <complexType>
                    <sequence>
                        <element name="UsernameToken" 
type="tns:UsernameTokenType"/>
                    </sequence>
                    <anyAttribute namespace="##other" processContents="lax"/>
                </complexType>
            </element>

            <complexType name="UsernameTokenType">
                <sequence>
                    <element name="Username" type="tns:UsernameType"/>
                    <element name="Password" type="tns:PasswordType"/>
                </sequence>
                <attribute name="Id" type="xsd:ID"/>
            </complexType>

            <complexType name="UsernameType">
                <simpleContent>
                    <extension base="xsd:string">
                        <attribute name="Id" type="xsd:ID"/>
                    </extension>
                </simpleContent>
            </complexType>

            <complexType name="PasswordType">
                <simpleContent>
                    <extension base="xsd:string">
                        <attribute name="Type" type="xsd:anyURI"/>
                    </extension>
                </simpleContent>
            </complexType>

            <!-- Common types -->

            <complexType name="ServiceType">
                <attribute name="APIVersion" use="required">
                    <simpleType>
                        <restriction base="xsd:string">
                            <enumeration value="V1"/>
                        </restriction>
                    </simpleType>
                </attribute>
            </complexType>

            <complexType name="ActionCredentials">
                <sequence>
                    <element name="originNumber" type="xsd:string"/>
                    <element name="password" type="xsd:string"/>
                </sequence>
            </complexType>
            
            <element name="ActionResultType">
                <complexType>
                    <restriction base="xsd:string">
                        <enumeration value="Success"/>
                        <enumeration value="Connection Failure"/>
                        <enumeration value="Destination Number not available"/>
                        <enumeration value="Requestor not authorized"/>
                        <enumeration value="Internal Server Error"/>
                    </restriction>
                </complexType>
            </element>

            <!-- Fault types -->

            <element name="ConnectionFailureFault">
                <complexType>
                    <sequence>
                        <element name="Connection Failure" type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>

            <element name="DestinationNotAvailableFault">
                <complexType>
                    <sequence>
                        <element name="Destination Number not available" 
type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>

            <element name="RequestorNotAuthorizedFault">
                <complexType>
                    <sequence>
                        <element name="Requestor not authorized" 
type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>

            <element name="InternalServerErrorFault">
                <complexType>
                    <sequence>
                        <element name="Internal Server Error" 
type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>

            <element name="ServiceValidationFault">
                <complexType>
                    <sequence>
                        <element name="Unsupported WSDL Version" 
type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>

            <!-- Op Control types -->

            <simpleType name="OpControlActionType">
                <restriction base="xsd:string">
                    <enumeration value="makeOp"/>
                    <enumeration value="disconnectOp"/>
                    <enumeration value="holdOp"/>
                    <enumeration value="conferenceOp"/>
                    <enumeration value="transferOp"/>
                </restriction>
            </simpleType>

            <element name="OpControlActionRequest">
                <complexType>
                    <sequence>
                        <element name="actionType" 
type="tns:OpControlActionType" minOccurs="1" maxOccurs="1"/>
                        <element name="credentials" 
type="tns:ActionCredentials" minOccurs="1" maxOccurs="1"/>
                        <element name="destinationNumber" type="xsd:string" 
minOccurs="1" maxOccurs="1"/>
                        <element name="serviceValidator" type="tns:ServiceType" 
minOccurs="1" maxOccurs="1"/>
                    </sequence>
                </complexType>
            </element>

            <!-- Device Config types -->

            <simpleType name="DeviceConfigActionType">
                <restriction base="xsd:string">
                    <enumeration value="handsFree"/>
                    <enumeration value="muteDevice"/>
                    <enumeration value="dndSet"/>
                    <enumeration value="fwdMailSet"/>
                    <enumeration value="fwdMailReset"/>
                    <enumeration value="cfuConfig"/>
                    <enumeration value="cfbConfig"/>
                    <enumeration value="cfrnaConfig"/>
                    <enumeration value="huntGroupLogin"/>
                    <enumeration value="huntGroupLogout"/>
                </restriction>
            </simpleType>

            <element name="DeviceConfigActionRequest">
                <complexType>
                    <sequence>
                        <element name="actionType" 
type="tns:DeviceConfigActionType" minOccurs="1" maxOccurs="1"/>
                        <element name="credentials" 
type="tns:ActionCredentials" minOccurs="1" maxOccurs="1"/>
                        <element name="destinationNumber" type="xsd:string" 
minOccurs="1" maxOccurs="1"/>
                        <element name="serviceValidator" type="tns:ServiceType" 
minOccurs="1" maxOccurs="1"/>
                    </sequence>
                </complexType>
            </element>

        </schema>
    </wsdl:types>

    <!-- Action messages -->

    <wsdl:message name="opControlRequest">
        <wsdl:part name="Security" element="tns:SecurityType"/>
        <wsdl:part name="opControlRequest" 
element="tns:OpControlActionRequest"/>
    </wsdl:message>

    <wsdl:message name="opControlResponse">
        <wsdl:part name="opControlResponse" element="tns:ActionResultType"/>
    </wsdl:message>

    <wsdl:message name="deviceConfigRequest"> 
        <wsdl:part name="Security" element="tns:SecurityType"/>
        <wsdl:part name="deviceConfigRequest" 
element="tns:DeviceConfigActionRequest"/>
    </wsdl:message>
    
    <wsdl:message name="deviceConfigResponse"> 
        <wsdl:part name="deviceConfigResponse" element="tns:ActionResultType"/>
    </wsdl:message>

    <!-- Telephony Result messages -->

    <wsdl:message name="ConnectionFailure">
        <wsdl:part name="Fault" element="tns:ConnectionFailureFault"/>
    </wsdl:message>
    
    <wsdl:message name="DestinationNotAvailable">
        <wsdl:part name="Fault" element="tns:DestinationNotAvailableFault"/>
    </wsdl:message>
    
    <wsdl:message name="RequestorNotAuthorized">
        <wsdl:part name="Fault" element="tns:RequestorNotAuthorizedFault"/>
    </wsdl:message>

    <wsdl:message name="InternalServerError">
        <wsdl:part name="Fault" element="tns:InternalServerErrorFault"/>
    </wsdl:message>

    <wsdl:message name="ServiceValidation">
        <wsdl:part name="fault" element="tns:ServiceValidationFault"/>
    </wsdl:message>

    <!-- Operations -->
 
    <wsdl:portType name="TestService">

        <wsdl:operation name="opControlRequest">
            <wsdl:input  message="tns:opControlRequest"/>
            <wsdl:output message="tns:opControlResponse"/>
            <wsdl:fault name="ConnectionFailure" 
message="tns:ConnectionFailure"/>
            <wsdl:fault name="DestinationNotAvailable" 
message="tns:DestinationNotAvailable"/>
            <wsdl:fault name="InternalServerError" 
message="tns:InternalServerError"/>
            <wsdl:fault name="RequestorNotAuthorized" 
message="tns:RequestorNotAuthorized"/>
            <wsdl:fault name="ServiceValidation" 
message="tns:ServiceValidation"/>
        </wsdl:operation>

        <wsdl:operation name="deviceConfigRequest">
            <wsdl:input  message="tns:deviceConfigRequest"/>
            <wsdl:output message="tns:deviceConfigResponse"/>
            <wsdl:fault name="ConnectionFailure" 
message="tns:ConnectionFailure"/>
            <wsdl:fault name="DestinationNotAvailable" 
message="tns:DestinationNotAvailable"/>
            <wsdl:fault name="InternalServerError" 
message="tns:InternalServerError"/>
            <wsdl:fault name="RequestorNotAuthorized" 
message="tns:RequestorNotAuthorized"/>
            <wsdl:fault name="ServiceValidation" 
message="tns:ServiceValidation"/>
        </wsdl:operation>
    
    </wsdl:portType>

    <!-- Bindings -->

    <wsdl:binding name="TestService" type="tns:TestService">

        <wsdlsoap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="opControlRequest">
            <wsdlsoap:operation 
soapAction="http://ws.test.sample.com/TestService/opControlRequest"/>
            <wsdl:input>
                <wsdlsoap:body use="literal"/>
                <wsdlsoap:header message="tns:opControlRequest" part="Security" 
use="literal"
                             namespace="http://ws.test.sample.com/WSSecurity/"/>
            </wsdl:input>
            <wsdl:output><wsdlsoap:body use="literal"/></wsdl:output>
            <wsdl:fault name="ConnectionFailure">
                <wsdlsoap:fault use="literal" name="ConnectionFailure"/>
            </wsdl:fault>
            <wsdl:fault name="DestinationNotAvailable">
                <wsdlsoap:fault use="literal" name="DestinationNotAvailable"/>
            </wsdl:fault>
            <wsdl:fault name="InternalServerError">
                <wsdlsoap:fault use="literal" name="InternalServerError"/>
            </wsdl:fault>
            <wsdl:fault name="RequestorNotAuthorized">
                <wsdlsoap:fault use="literal" name="RequestorNotAuthorized"/>
            </wsdl:fault>
            <wsdl:fault name="ServiceValidation">
                <wsdlsoap:fault use="literal" name="ServiceValidation"/>
            </wsdl:fault>
        </wsdl:operation>

        <wsdl:operation name="deviceConfigRequest">
            <wsdlsoap:operation 
soapAction="http://ws.test.sample.com/TestService/deviceConfigRequest"/>
            <wsdl:input>
                <wsdlsoap:body use="literal"/>
                <wsdlsoap:header message="tns:deviceConfigRequest" 
part="Security" use="literal"
                             namespace="http://ws.test.sample.com/WSSecurity/"/>
            </wsdl:input>
            <wsdl:output><wsdlsoap:body use="literal"/></wsdl:output>
            <wsdl:fault name="ConnectionFailure">
                <wsdlsoap:fault use="literal" name="ConnectionFailure"/>
            </wsdl:fault>
            <wsdl:fault name="DestinationNotAvailable">
                <wsdlsoap:fault use="literal" name="DestinationNotAvailable"/>
            </wsdl:fault>
            <wsdl:fault name="InternalServerError">
                <wsdlsoap:fault use="literal" name="InternalServerError"/>
            </wsdl:fault>
            <wsdl:fault name="RequestorNotAuthorized">
                <wsdlsoap:fault use="literal" name="RequestorNotAuthorized"/>
            </wsdl:fault>
            <wsdl:fault name="ServiceValidation">
                <wsdlsoap:fault use="literal" name="ServiceValidation"/>
            </wsdl:fault>
        </wsdl:operation>

    </wsdl:binding>

    <wsdl:service name="TestService">
        <wsdl:port binding="tns:TestService" name="TestService">
            <soap:address 
location="http://localhost/axis2/services/TestService"/>
        </wsdl:port>
    </wsdl:service>
    
</wsdl:definitions>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to