cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcs <tah...@hotmail.com>
Subject array - difference between JAXB and Aegis Binding
Date Thu, 13 Dec 2007 21:48:14 GMT

Hi, 

I wrote a simple web service with two methods, one that would take an array
and one that would return an array.

    public String[] getAbc() {
    	String[] strs = new String[3];
    	strs[0] = "a";
       	strs[1] = "b";
       	strs[2] = "c";
        return strs;
    }
    
    public String setAbc(String[] args) {
    	return "done";
    }

I noticed that with JAXB binding, the WSDL created does not have the wrapper
'ArrayOf...' element present.

<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified" targetNamespace="http://server.hw.demo/"
xmlns:tns="http://server.hw.demo/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:element name="setAbc" type="tns:setAbc"/>

 <xsd:complexType name="setAbc">
   <xsd:sequence>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="arg0"
type="xsd:string"/>
   </xsd:sequence>
  </xsd:complexType>

 <xsd:element name="setAbcResponse" type="tns:setAbcResponse"/>

 <xsd:complexType name="setAbcResponse">
   <xsd:sequence>
    <xsd:element minOccurs="0" name="return" type="xsd:string"/>
  </xsd:sequence>
 </xsd:complexType>

 <xsd:element name="getAbc" type="tns:getAbc"/>

 <xsd:complexType name="getAbc">
    <xsd:sequence/>
 </xsd:complexType>

 <xsd:element name="getAbcResponse" type="tns:getAbcResponse"/>
 <xsd:complexType name="getAbcResponse">
   <xsd:sequence>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="return"
type="xsd:string"/>
   </xsd:sequence>
 </xsd:complexType>

</xsd:schema>


However with Aegis binding, the wrapper 'ArrayOf...' elements are present. 
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://server.hw.demo/">
    <xsd:complexType name="ArrayOfString">
        <xsd:sequence>
            <xsd:element maxOccurs="unbounded" minOccurs="0" name="string"
nillable="true" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="setAbc" type="tns:setAbc"/>
    <xsd:complexType name="setAbc">

        <xsd:sequence>
            <xsd:element name="arg0" nillable="true"
type="tns:ArrayOfString"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="setAbcResponse" type="tns:setAbcResponse"/>
    <xsd:complexType name="setAbcResponse">
        <xsd:sequence>
            <xsd:element minOccurs="0" name="return" type="xsd:string"/>
        </xsd:sequence>

    </xsd:complexType>
    <xsd:element name="getAbc" type="tns:getAbc"/>
    <xsd:complexType name="getAbc">
        <xsd:sequence/>
    </xsd:complexType>
    <xsd:element name="getAbcResponse" type="tns:getAbcResponse"/>
    <xsd:complexType name="getAbcResponse">
        <xsd:sequence>
            <xsd:element name="return" nillable="true"
type="tns:ArrayOfString"/>

        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

I'd like to use Aegis binding. But would like my WSDL to not have the
wrapper 'ArrayOf...' elements.  Is that possible?

thanks,

Just as an fyi.. this issue was discussed in this thread:
http://www.nabble.com/JAX-WS-Array-Support-tt8483460.html#a8483460




-- 
View this message in context: http://www.nabble.com/array---difference-between-JAXB-and-Aegis-Binding-tp14325476p14325476.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message