Amila Suriarachchi ha scritto:
First of all now I have fixed the unwrapping problem and you should be
able to generate the code correctly with a nighly build.

Hi Amila,
unfortunately I'm still experiencing problems: this seems not to be fixed...

When you have empty return types, Axis2 doesn't unwrap the output to void, even if I specify -uw. Unwrapping of input parameters, instead, seems to work fine.

I'm attaching a WSDL that shows the problem. There are two methods:
- aMethod defines a response of an anonymous empty type; Axis2 generates a method that returns AMethodResponse, instead of void - bMethod defines a response of type EmptyType: Axis2 generates a method that returns EmptyType, instead of void

I tried also with the latest nightly build...

I also found out that this can actually be a problem, because in order to get parameters unwrapped by .NET correctly, it is mandatory to specify both request and response messages with a part with name "parameters". The part may refer to empty types, in order to be unwrapped to void by .NET. If you remove the part from the request or response message (so that Axis2 correctly generates void), .NET still generates void, but does not unwrap the output or input parameters respectively.

For instance, suppose you have:

<wsdl:message name="logoutRequest">
  <part name="parameters" element="txsns:logout" />
</wsdl:message>
<wsdl:message name="logoutResponse" />

in .NET this is translated to:
public void logout(logout logout1) (where type logout is a "bean")

If Axis2 could unwrap empty types correctly, it would not be a problem to define something like:

<wsdl:message name="logoutRequest">
  <part name="parameters" element="txsns:logout" />
</wsdl:message>
<wsdl:message name="logoutResponse">
  <part name="parameters" element="txsns:logoutResponse" />
</wsdl:message>

with schema:

<xsd:element name="logout">
  <xsd:complexType>
    <sequence>
      <element name="ticket" type="xsd:string" />
    </sequence>
  </xsd:complexType>
</xsd:element>
<xsd:element name="logoutResponse">
  <xsd:complexType/>
</xsd:element>

in order to get:

public void logout(string ticket) => .NET
and
public void logout(String ticket) => Java with Axis2

Thanks in advance!

--
Mauro Molinari
Software Developer
[EMAIL PROTECTED]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
  xmlns:tns="http://mauro/Prova";
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="ProvaService"
  targetNamespace="http://mauro/Prova";
  xmlns:txsns="http://mauro/Prova/type";>
  <wsdl:types>
    <xsd:schema targetNamespace="http://mauro/Prova/type";
      xmlns:txsns="http://mauro/Prova/type";>
      <xsd:element name="aMethod">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="a" type="xsd:string" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>

      <xsd:element name="aMethodResponse">
        <xsd:complexType />
      </xsd:element>

      <xsd:complexType name="EmptyType" />

      <xsd:element name="bMethod">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="a" type="xsd:string" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>

      <xsd:element name="bMethodResponse" type="txsns:EmptyType" />
    </xsd:schema>
  </wsdl:types>

  <wsdl:message name="aMethodRequest">
    <wsdl:part element="txsns:aMethod" name="parameters" />
  </wsdl:message>
  <wsdl:message name="aMethodResponse">
    <wsdl:part element="txsns:aMethodResponse" name="parameters" />
  </wsdl:message>
  <wsdl:message name="bMethodRequest">
    <wsdl:part name="parameters" element="txsns:bMethod"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="bMethodResponse">
    <wsdl:part name="parameters" element="txsns:bMethodResponse"></wsdl:part>
  </wsdl:message>
  <wsdl:portType name="ProvaService">
    <wsdl:operation name="aMethod">
      <wsdl:input message="tns:aMethodRequest" />
      <wsdl:output message="tns:aMethodResponse" />
    </wsdl:operation>
    <wsdl:operation name="bMethod">
      <wsdl:input message="tns:bMethodRequest"></wsdl:input>
      <wsdl:output message="tns:bMethodResponse"></wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="ProvaServiceSOAP" type="tns:ProvaService">

    <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http"; />
    <wsdl:operation name="aMethod">

      <soap:operation soapAction="http://mauro/Prova/aMethod"; />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>

    <wsdl:operation name="bMethod">
      <soap:operation soapAction="http://mauro/Prova/bMethod"; />

      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>

        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

  <wsdl:service name="ProvaService">
    <wsdl:port binding="tns:ProvaServiceSOAP" name="ProvaServiceSOAP">
      <soap:address location="http://www.example.org/"; />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

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

Reply via email to