IDL union type mapping ---------------------- Key: YOKO-203 URL: http://issues.apache.org/jira/browse/YOKO-203 Project: Yoko - CORBA Server Issue Type: Bug Components: Idl2Wsdl Affects Versions: 1.0-incubating-M2 Reporter: Matteo Vescovi Assigned To: Matteo Vescovi Priority: Minor
According to the CORBA Binding for WSDL specification document, the mapping for IDL unions differs from the CORBA to WSDL/SOAP Interworking Specification (formal/03-11-02) in that IDL union maps to a pure xs:choice rather than to a discriminated choice. Just as with the any in the previous point, what matters to the application is the union value. The discriminator is required only in unions in which discriminator values do not correspond to any union case members, such that setting the discriminator to one of those values means that only the discriminator is sent across the wire. Such cases are better handled by nillable XML Schema types. However, IDL unions are currently mapped according to the CORBA to WSDL/SOAP Interworking Specification (formal/03-11-02). Following is an example of the mapping mandated by the CORBA to WSDL/SOAP Interworking Specification (formal/03-11-02): module Example { union myUnion switch (long) { case 0: long l; case 1: string str; case 2: case 3: float f; default: octet o; }; }; This union maps onto the following XML schema definition: <xsd:complexType name="Example.myUnion"> <xsd:sequence> <xsd:element name="discriminator" type="xsd:int" /> <xsd:choice> <!-- case 0 --> <xsd:element name="l" type="xsd:int" minOccurs="0" maxOccurs="1" /> <!-- case 1 --> <xsd:element name="str" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="1" /> <!-- case 2, 3 --> <xsd:element name="f" type="xsd:float" minOccurs="0" maxOccurs="1" /> <!-- default case --> <xsd:element name="o" type="xsd:byte" minOccurs="0" maxOccurs="1" /> </xsd:choice> </xsd:sequence> </xsd:complexType> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira