It's been awhile since I've seen the holder types, but IIRC switching to non-wrapper style ( http://cxf.apache.org/docs/wsdl-to-java.html#WSDLtoJava-wrapperstyle) should get rid of the need for them.

Glen

On 08/18/2012 07:44 AM, Marcel Stör wrote:
WSDL and its mapping to Java never fail to puzzle me. Just don't see through...

Currently I'm confused about OUT parameters vs. return types.

The CXF example[1] explains that "If there is more than one output parameter, the second and subsequent output parameters map to method arguments (moreover, the values of these arguments must be passed using Holder types)."

That much seems clear. Then why is the mapping different for the two below scenarios?

<wsdl:operation name="method">
  <wsdl:output message="methodResponse" />

[Return type]
This WSDL/XSD produces a Java method that has a return type because the WSDL output message /references/ a complex type rather than declaring it "inline"?
<xs:element name="methodResponse">
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="nsType"/>
      <xs:element ref="msType"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>
<xs:complexType name="nsType">
  <xs:sequence>
    <xs:element ref="someType" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>
<xs:complexType name="msType">
  <xs:sequence>
    <xs:element ref="someType" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>

[OUT parameter]
This WSDL/XSD produces a Java method with those terrible Holders as OUT parameters.
<xs:element name="methodResponse">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="nsType" minOccurs="1" maxOccurs="1">
        <xs:complexType>
          <xs:sequence>
<xs:element ref="someType" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>


I found similar questions in the archive[2][3] but I still don't get it.

Cheers,
Marcel

[1] http://cxf.apache.org/docs/developing-a-consumer.html#DevelopingaConsumer-Example3 [2] http://cxf.547215.n5.nabble.com/How-to-avoid-that-multiple-WebParam-Mode-OUT-params-are-generated-td4587065.html [3] http://cxf.547215.n5.nabble.com/wsdl2java-avoiding-INOUT-parameters-in-wrapper-style-td2827683.html


Reply via email to