wsdl2java -w, --wrapArrays
When processing a schema like:
<xsd:element name="string_array">
 <xsd:complexType>
  <xsd:sequence>
   <xsd:element maxOccurs="1" minOccurs="1" name="string_item" 
type="xs:string"/>
  </xsd:sequence>
 </xsd:complexType>
</xsd:element>

The default behavior (as of Axis 1.2 final) is to map this XML construct to a 
Java String array (String[]). If you would rather a specific JavaBean class 
(i.e. ArrayOfString) be generated for these types of schemas, you may specify 
the -w or --wrapArrays option. 

 

//then declare array_string_array (using the already declared string_array type)

<xsd:element name="array_string_array">
 <xsd:complexType>
  <xsd:sequence>
   <xsd:element maxOccurs="1" minOccurs="1" name="string_array_item" 
type="tns:string_array"/>
  </xsd:sequence>
 </xsd:complexType>
</xsd:element


//tns is defined in the wsdl:definitions e.g.

<wsdl:definitions 
  xmlns:tns="http://fmcsa.gov/WRIBOSService/"; 


<!-- and xsd is  XMLSchema spec -->

xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 

..

>

 

anyone else?
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.



 



Date: Fri, 25 Jun 2010 17:23:21 +0530
Subject: Re: Does Axis2 support 2d array?
From: cch...@gmail.com
To: java-user@axis.apache.org

Amila,


Could you please mention what are the minimal jar(s) I need to add/replace with 
the lib of Axis2 1.4.1 to support 2D String array stuff?


Chinmoy







On Sun, Jun 13, 2010 at 9:45 AM, Amila Suriarachchi 
<amilasuriarach...@gmail.com> wrote:

deploy a POJO service with the following method as in other POJO.

 public String[][] echo(String[][] stringArray){
        return stringArray;
    }

you will get a wsdl like this.



<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:ns1="http://org.apache.axis2/xsd"; 
xmlns:ns="http://service.test.apache.org"; 
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"; 
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; 
targetNamespace="http://service.test.apache.org";>


    <wsdl:documentation>TestSecurity</wsdl:documentation>
    <wsdl:types>
        <xs:schema attributeFormDefault="qualified" 
elementFormDefault="qualified" targetNamespace="http://service.test.apache.org";>


            <xs:element name="echo">
                <xs:complexType>

                    <xs:sequence>
                        <xs:element maxOccurs="unbounded" minOccurs="0" 
name="stringArray" nillable="true" type="ns:ArrayOfString"/>


                    </xs:sequence>
                </xs:complexType>
            </xs:element>

            <xs:complexType name="ArrayOfString">
                <xs:sequence>

                    <xs:element maxOccurs="unbounded" minOccurs="0" 
name="array" nillable="true" type="xs:string"/>


                </xs:sequence>
            </xs:complexType>
            <xs:element name="echoResponse">

                <xs:complexType>
                    <xs:sequence>
                        <xs:element maxOccurs="unbounded" minOccurs="0" 
name="return" nillable="true" type="ns:ArrayOfString"/>


                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>

    </wsdl:types>
    <wsdl:message name="echoRequest">
        <wsdl:part name="parameters" element="ns:echo"/>

    </wsdl:message>
    <wsdl:message name="echoResponse">
        <wsdl:part name="parameters" element="ns:echoResponse"/>


    </wsdl:message>
    <wsdl:portType name="TestSecurityPortType">

        <wsdl:operation name="echo">
            <wsdl:input message="ns:echoRequest" wsaw:Action="urn:echo"/>


            <wsdl:output message="ns:echoResponse" 
wsaw:Action="urn:echoResponse"/>

        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="TestSecuritySoap11Binding" 
type="ns:TestSecurityPortType">


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


        <wsdl:operation name="echo">
            <soap:operation soapAction="urn:echo" style="document"/>


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

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


            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="TestSecuritySoap12Binding" 
type="ns:TestSecurityPortType">


        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"; 
style="document"/>


        <wsdl:operation name="echo">
            <soap12:operation soapAction="urn:echo" style="document"/>


            <wsdl:input>
                <soap12:body use="literal"/>

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

            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="TestSecurityHttpBinding" type="ns:TestSecurityPortType">


        <http:binding verb="POST"/>
        <wsdl:operation name="echo">

            <http:operation location="echo"/>
            <wsdl:input>

                <mime:content type="text/xml" part="parameters"/>

            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="parameters"/>


            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="TestSecurity">


        <wsdl:port name="TestSecurityHttpSoap11Endpoint" 
binding="ns:TestSecuritySoap11Binding">

            <soap:address 
location="http://localhost:8080/axis2/services/TestSecurity.TestSecurityHttpSoap11Endpoint/"/>


        </wsdl:port>
        <wsdl:port name="TestSecurityHttpSoap12Endpoint" 
binding="ns:TestSecuritySoap12Binding">


            <soap12:address 
location="http://localhost:8080/axis2/services/TestSecurity.TestSecurityHttpSoap12Endpoint/"/>


        </wsdl:port>
        <wsdl:port name="TestSecurityHttpEndpoint" 
binding="ns:TestSecurityHttpBinding">


            <http:address 
location="http://localhost:8080/axis2/services/TestSecurity.TestSecurityHttpEndpoint/"/>


        </wsdl:port>
    </wsdl:service>

thanks,
Amila.






On Sat, Jun 12, 2010 at 4:28 PM, Prateek Asthana <pary...@gmail.com> wrote:

Amila,
Can you please post an example or so.

Thanks,
Prateek





On Sat, Jun 12, 2010 at 4:40 AM, Amila Suriarachchi
<amilasuriarach...@gmail.com> wrote:
> Axis2 trunk supports 2D Arrays. please have a look at with a snapshot[1].
>
> thanks,
> Amila.
>
> [1]
> http://repository.apache.org/snapshots/org/apache/axis2/distribution/SNAPSHOT/
>
> On Mon, Jun 7, 2010 at 5:57 PM, Deepal Jayasinghe <deep...@gmail.com> wrote:
>>
>> Axis2 does not support 2D arrays for POJOs, but I am not sure about
>> the code generation.
>>
>> On Mon, Jun 7, 2010 at 4:32 AM, Chinmoy Chakraborty <cch...@gmail.com>
>> wrote:
>> > Hello,
>> > In the following link, I noticed that Axis2 does not support 2D array.
>> > Does
>> > it support in latest released code?
>> > http://software.itags.org/apache/15330/
>> > Chinmoy
>> >
>> >
>>
>>
>>
>> --
>> http://blogs.deepal.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
>> For additional commands, e-mail: java-user-h...@axis.apache.org
>>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
For additional commands, e-mail: java-user-h...@axis.apache.org



-- 



Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

                                          
_________________________________________________________________
The New Busy is not the old busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3

Reply via email to