You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "Li, Tao (Tom)" <Ta...@iona.com> on 2006/12/11 08:20:28 UTC

JAXBElement issue

Hi all,

When I try to do mtom interop test with .net.
I've encountered a JAXBElement problem. 

Schemas provided:

<xs:schema elementFormDefault="qualified" targetNamespace="http://xmlsoap.org/Ping"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://xmlsoap.org/Ping">

    <xs:element name="EchoStringAsBinary">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs=0 name="s" nillable="true" type="xs:string" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="EchoStringAsBinaryResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs=0 name="EchoStringAsBinaryResult" nillable="true"
                    type="xs:base64Binary" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="MtomTestStruct">
        <xs:sequence>
            <xs:element  name="Array" nillable="true" type="xs:base64Binary" />
            <xs:element  name="Name" nillable="true" type="xs:string" />
        </xs:sequence>
    </xs:complexType>
    <xs:element name="MtomTestStruct" nillable="true" type="tns:MtomTestStruct" />
    <xs:element name="ByteArray" nillable="true" type="xs:base64Binary" />
    <xs:element name="StringValue" nillable="true" type="xs:string" />
</xs:schema>


With the minOccurs=0, the JAXB schema compiler generated code with
JAXBElement wrapper

    public JAXBElement<String> getS() {
        return s;
    }

    public void setS(JAXBElement<String> value) {
        this.s = value;
    }

And our WrapperHelper class can't handle code generated as above.

Is it a bug of JAXB, or should our CXF code to support JAXBElement
type handling?

Thanks very much for comments.

Tom