Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 22130 invoked from network); 9 Sep 2009 13:50:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Sep 2009 13:50:04 -0000 Received: (qmail 78969 invoked by uid 500); 9 Sep 2009 13:49:01 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 78939 invoked by uid 500); 9 Sep 2009 13:49:00 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 78929 invoked by uid 99); 9 Sep 2009 13:49:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Sep 2009 13:49:00 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of amilasuriarachchi@gmail.com designates 74.125.92.144 as permitted sender) Received: from [74.125.92.144] (HELO qw-out-1920.google.com) (74.125.92.144) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Sep 2009 13:48:50 +0000 Received: by qw-out-1920.google.com with SMTP id 4so1658316qwk.28 for ; Wed, 09 Sep 2009 06:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=bk3uVMXNsm8Z0yzte85ZfGlMsdOo4TKKs1pxzlXFyEc=; b=o7DiQ3+rQQtI5RNqBBfNyfKGV6M2HGC9CghsH5HZIdygBpmr72oJalrRbDWaXH0yBY Kp2YKItR6Gp4RCTxsTovEs9hybdfjB14UNwMqVXW+xCdH4JB2n935x3PdCsC+jxqUoKd Mn7FkcW+W2R4JT4E3XvtqTWQrW6FN3V8bKc1U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=PKzNMN2uEbdIZJPEdsHtQ54jp4B/lg75x7jbG9CpftHfDDxYeYn/6Z71vnEdhyouba YBpEso6TuvLoPl69erI2yJhNZTLEl5J35zsa5Vm9PApRala3yTpxtXIs2Lvy7jLLxbgb ZSEFmRd2XnOS5ND9YEBDWITRW/GI2xJYFfy/4= MIME-Version: 1.0 Received: by 10.229.54.148 with SMTP id q20mr27918qcg.18.1252504108946; Wed, 09 Sep 2009 06:48:28 -0700 (PDT) In-Reply-To: References: Date: Wed, 9 Sep 2009 19:18:28 +0530 Message-ID: <60708f4b0909090648h7be99310g8c08ec50c219af6f@mail.gmail.com> Subject: Re: problem with returning array of objects From: Amila Suriarachchi To: axis-user@ws.apache.org Content-Type: multipart/alternative; boundary=001517741bbc7e54250473255653 X-Virus-Checked: Checked by ClamAV on apache.org --001517741bbc7e54250473255653 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Sep 9, 2009 at 6:48 PM, P=E4r Malmqvist = wrote: > Hello! > > I have problem with generating server side code from my wsdl file. > The wsdl file contains a service, getAtcsByAtcCode, that should return an > array of Atc-objects. > But my generated code returns OMElement[] instead. > > I use this wsdl file: > > > xmlns:apachesoap=3D"http://xml.apache.org/xml-soap" > xmlns:tns=3D"http://main.sol" > xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/" > xmlns:wsdlsoap=3D"http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"> > > http://main.sol" > xmlns=3D"http://www.w3.org/2001/XMLSchema" > xmlns:apachesoap=3D"http://xml.apache.org/xml-soap" > xmlns:tns=3D"http://main.sol" xmlns:intf=3D"http://main.sol" > xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/"> > > > > > > > > > > > > > > > > > > > > > > > > > > name=3D"return" type=3D"tns:Atc"/> > this type should be a complex type. not an element. thanks, Amila. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > name=3D"getAtcsByAtcCodeRequest"/> > name=3D"getAtcsByAtcCodeResponse"/> > name=3D"SolExceptionFault"/> > > > > > http://schemas.xmlsoap.org/soap/http"/> > > > > > > > > > > > > > > > > > http://localhost:8080/axis2/services/SolDB2"/> > > > > > > > > I generate my service with the following ant task: > > (lib directory contains all Axis2 jars) > > > > > > > > > > > > > > > > > > > > > > > > > When I check the generated file GetAtcsByAtcCodeResponse.java I see that > the object contains an > array of org.apache.axiom.om.OMElement[] instead of sol.main.Atc[]. > > > Is there something wrong with my wsdl file? > Or is this the way to do when returning array of objects at the service > side? > > Regards > > P=E4r Malmqvist > > > > ------------------------------ > Share your memories online with anyone you want anyone you want. > --=20 Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/ --001517741bbc7e54250473255653 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Wed, Sep 9, 2009 at 6:48 PM, P=E4r Ma= lmqvist <= par_malmqvist@hotmail.com> wrote:
Hello!

I have problem with generating server side code from my wsdl = file.
The wsdl file contains a service, getAtcsByAtcCode, that should re= turn an array of Atc-objects.
But my generated code returns OMElement[] = instead.

I use this wsdl file:

<?xml version=3D"1.0" encodin= g=3D"UTF-8"?>
<wsdl:definitions targetNamespace=3D"= http://main.sol"
= =A0=A0 =A0xmlns:apachesoap=3D"http://xml.apache.org/xml-soap"
=A0=A0=A0=A0=A0=A0=A0 xmlns:tns=3D"http://main.sol"
=A0=A0 =A0xmlns:wsdl=3D"http://schemas.xm= lsoap.org/wsdl/"
=A0=A0 =A0xmlns:wsdlsoap=3D"http://schemas.xmlsoap.org/wsdl/soap/"=A0=A0 =A0xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema">
=A0=A0 =A0<wsdl:types>
=A0=A0 =A0=A0=A0 =A0<schema elementFormD= efault=3D"qualified" targetNamespace=3D"http://main.sol"
=A0=A0 =A0=A0=A0 =A0= =A0=A0 =A0xmlns=3D"http://www.w3.org/2001/XMLSchema"
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0xmlns:apachesoap=3D"http://xml.apache.org/xml-soap= "
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0xmlns:tns=3D"http://main.sol" xmlns:intf=3D"<= a href=3D"http://main.sol" target=3D"_blank">http://main.sol"
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/&q= uot;>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <element name=3D"Atc&quo= t;>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<complexType>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<sequence>
=A0= =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<element name= =3D"atcCode" type=3D"xsd:string"/>
=A0=A0 =A0=A0= =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<element name=3D"lev= " type=3D"xsd:int"/>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<element nam= e=3D"textSv" type=3D"xsd:string"/>
=A0=A0 =A0=A0= =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<element name=3D"MAX= _LEN_atcCode" type=3D"xsd:string"/>
=A0=A0 =A0=A0=A0 = =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<element name=3D"MAX_LEN= _textSv" type=3D"xsd:string"/>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0</sequence>
=A0= =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0</complexType>
=A0=A0 =A0=A0= =A0 =A0=A0=A0 =A0</element>


=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0= <element name=3D"getAtcsByAtcCode">
=A0=A0 =A0=A0=A0 =A0= =A0=A0 =A0=A0=A0 =A0<complexType>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<sequence>
=A0= =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<element name= =3D"atcCode" type=3D"xsd:string"/>
=A0=A0 =A0=A0= =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0</sequence>
=A0=A0 =A0=A0=A0 = =A0=A0=A0 =A0=A0=A0 =A0</complexType>
=A0=A0 =A0=A0=A0 =A0=A0=A0 = =A0</element>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<element= name=3D"getAtcsByAtcCodeResponse">
=A0=A0 =A0=A0=A0 =A0=A0= =A0 =A0=A0=A0 =A0<complexType>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0= =A0 =A0=A0=A0 =A0<sequence>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 = =A0=A0=A0 =A0=A0=A0 =A0<element maxOccurs=3D"unbounded" minOcc= urs=3D"0" name=3D"return" type=3D"tns:Atc"/&g= t;

this type should be a complex type. not an elem= ent.

thanks,
Amila.

=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0</sequence>=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0</complexType>
=A0=A0 =A0= =A0=A0 =A0=A0=A0 =A0</element>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0
= =A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<element name=3D"SolException"&g= t;
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<complexType>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<sequence>
=A0= =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<element name= =3D"errorCode" type=3D"xsd:int"/>
=A0=A0 =A0=A0= =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<element name=3D"err= orMsg" type=3D"xsd:string"/>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0</sequence>
=A0= =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0</complexType>
=A0=A0 =A0=A0= =A0 =A0=A0=A0 =A0</element>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0
=A0= =A0 =A0=A0=A0 =A0</schema>
=A0=A0 =A0</wsdl:types>
=A0=A0= =A0
=A0=A0 =A0<wsdl:message name=3D"getAtcsByAtcCodeRequest&quo= t;>
=A0=A0 =A0=A0=A0 =A0<wsdl:part element=3D"tns:getAtcsByAtcCode"= ; name=3D"parameters"/>
=A0=A0 =A0</wsdl:message>
= =A0=A0 =A0
=A0=A0 =A0<wsdl:message name=3D"getAtcsByAtcCodeRespo= nse">
=A0=A0 =A0=A0=A0 =A0<wsdl:part element=3D"tns:getA= tcsByAtcCodeResponse" name=3D"return"/>
=A0=A0 =A0</wsdl:message>
=A0=A0 =A0
=A0=A0 =A0<wsdl:message= name=3D"SolExceptionMessage">
=A0=A0 =A0=A0=A0 =A0<wsdl= :part element=3D"tns:SolException" name=3D"fault"/><= br>=A0=A0 =A0</wsdl:message>
=A0=A0 =A0
=A0=A0 =A0<wsdl:portType name=3D"SolDB2">
= =A0=A0 =A0=A0=A0 =A0<wsdl:operation name=3D"getAtcsByAtcCode"&= gt;
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<wsdl:input message=3D"tns:get= AtcsByAtcCodeRequest" name=3D"getAtcsByAtcCodeRequest"/><= br> =A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<wsdl:output message=3D"tns:getAtcsBy= AtcCodeResponse" name=3D"getAtcsByAtcCodeResponse"/>
= =A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<wsdl:fault message=3D"tns:SolExcepti= onMessage" name=3D"SolExceptionFault"/>
=A0=A0 =A0=A0=A0 =A0</wsdl:operation>
=A0=A0 =A0</wsdl:portType= >
=A0=A0 =A0
=A0=A0 =A0<wsdl:binding name=3D"SolDB2SoapBin= ding" type=3D"tns:SolDB2">
=A0=A0 =A0=A0=A0 =A0<wsd= lsoap:binding style=3D"document" transport=3D"http://schemas.xmlsoap= .org/soap/http"/>
=A0=A0 =A0=A0=A0 =A0<wsdl:operation name=3D"getAtcsByAtcCode"&= gt;
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<wsdlsoap:operation soapAction=3D&q= uot;"/>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<wsdl:input name=3D&quo= t;getAtcsByAtcCodeRequest">
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0= =A0<wsdlsoap:body use=3D"literal"/>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0</wsdl:input>
=A0=A0 =A0=A0=A0 =A0= =A0=A0 =A0<wsdl:output name=3D"getAtcsByAtcCodeResponse">=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<wsdlsoap:body use=3D"lit= eral"/>
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0</wsdl:output>
= =A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<wsdl:fault name=3D"SolExceptionFault= ">
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<wsdlsoap:fault name=3D"Sol= ExceptionFault" use=3D"literal"/>
=A0=A0 =A0=A0=A0 =A0= =A0=A0 =A0</wsdl:fault>
=A0=A0 =A0=A0=A0 =A0</wsdl:operation>= ;
=A0=A0 =A0</wsdl:binding>
=A0=A0 =A0
=A0=A0 =A0<wsdl:se= rvice name=3D"SolDB2">
=A0=A0 =A0=A0=A0 =A0<wsdl:port binding=3D"tns:SolDB2SoapBinding&quo= t; name=3D"SolDB2">
=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0<wsdls= oap:address location=3D"http://localhost:8080/axis2/services/SolDB2= "/>
=A0=A0 =A0=A0=A0 =A0</wsdl:port>
=A0=A0 =A0</wsdl:service>=A0=A0 =A0
</wsdl:definitions>



I generate my serv= ice with the following ant task:

(lib directory contains all Axis2 j= ars)


<target name=3D"gen.sol.src.service">

=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0 <delete dir=3D"soltarget"/= >
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0 <mkdir dir=3D"soltarget&quo= t;/>
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0 <mkdir dir=3D"soltarget/= classes"/>

=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0 <java classnam= e=3D"org.apache.axis2.wsdl.WSDL2Java" fork=3D"true">=
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <arg line=3D"-uri SolDB= 2.wsdl"/>
=A0=A0 =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0 =A0<arg line= =3D"-d adb"/>
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &= lt;arg line=3D"-ss"/>
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 <arg line=3D"-sd"/>
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <arg line=3D"-o soltarg= et"/>
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <classpath&= gt;
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0 =A0<fileset di= r=3D".\lib">
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0= =A0=A0 =A0=A0=A0=A0=A0=A0 <include name=3D"*.jar"/>
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0 =A0</fileset>
= =A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </classpath>
=A0=A0 = =A0=A0=A0=A0=A0=A0=A0=A0 </java>
</target>



Wh= en I check the generated file GetAtcsByAtcCodeResponse.java I see that the = object contains an
array of org.apache.axiom.om.OMElement[] instead of sol.main.Atc[].

=
Is there something wrong with my wsdl file?
Or is this the way to do= when returning array of objects at the service side?

Regards

P=E4r Malmqvist




Share your memories online with anyo= ne you want anyone you want.<= /a>



--
Amila Suriarachchi
W= SO2 Inc.
blog:
http://am= ilachinthaka.blogspot.com/
--001517741bbc7e54250473255653--