You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Barry Hathaway <bh...@nycap.rr.com> on 2011/08/03 23:00:52 UTC

POJO return types

Since I really didn't have any luck returning Lists or arrays, I decided 
to return
a simple POJO class in my POJO web service.  The class that I am trying 
to return
is defined on both the service and client side as:

     public class QueryResultSet {
         private List<Object> columnNames;
         private List<Object> resultSet;
         public QueryResultSet() {
         }
         public List<Object> getColumnNames() {
             return columnNames;
         }
         public void setColumnNames(List<Object> columnNames) {
             this.columnNames = columnNames;
         }
         public List<Object> getResultSet() {
             return resultSet;
         }
         public void setResultSet(List<Object> results) {
             this.resultSet = results;
         }
     }

On the client side, I call the service as:

         Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
         try {
             Object[] queryResponse = 
serviceClient.invokeBlocking(queryQName,
                     queryArgs, queryReturnTypes);
             QueryResultSet rs = (QueryResultSet) queryResponse[0];
             List<Object> colNames = rs.getColumnNames();
             List<Object> queryRows = rs.getResultSet();
             for (int i=0; i<colNames.size(); i++) {
                 log.info("Response from 'query' operation: column name 
"+colNames.get(i).toString());
             }

The log statement produces:

2011-08-03 16:47:53,059 [main           ] INFO  
SadlMain                       - Response from 'query' operation: column 
name <ax25:columnNames 
xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:type="xs:string">cw</ax25:columnNames>

I was expecting that by specifying the correct return type that the 
invokeBlocking call would "unwrap" the
QueryResultSet class in queryResponse[0] and just get cw.  Obviously, 
being a newbie, this isn't quite right.
Any ideas?

Thanks
Barry Hathaway


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


Re: Chunked response

Posted by Demetris <de...@ece.neu.edu>.
Hi Brett - with a bit more investigation I agree with you. I did find a 
way to turn off the chunking, just in case
it helps anyone else but I will go ahead and deal with it in my apps. 
Setting the ("Connection":"close") in
the response headers turns off persistent connectivity (as it is the 
default for HTTP 1.1)and it  avoids the
chunking.

Thanks

On 8/4/2011 1:02 PM, Okken,Brett wrote:
> A chunked response is typically a better option as eliminates the requirement to know the full size of the response before sending any data. It also, as I understand it, removes the limit on the size of the response.
>
> Brett
> -----Original Message-----
> From: Demetris [mailto:demetris@ece.neu.edu]
> Sent: Thursday, August 04, 2011 10:17 AM
> To: java-user@axis.apache.org
> Subject: Chunked response
>
>
> Hi all,
>
> is there a way to configure the server not to returned chunked data? Or dealing with the chunked data (may be reading the returned response using InputStreams) is more efficient than eliminating it?
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
> ----------------------------------------------------------------------
> CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

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


RE: Chunked response

Posted by "Okken,Brett" <BO...@CERNER.COM>.
A chunked response is typically a better option as eliminates the requirement to know the full size of the response before sending any data. It also, as I understand it, removes the limit on the size of the response.

Brett
-----Original Message-----
From: Demetris [mailto:demetris@ece.neu.edu] 
Sent: Thursday, August 04, 2011 10:17 AM
To: java-user@axis.apache.org
Subject: Chunked response


Hi all,

is there a way to configure the server not to returned chunked data? Or dealing with the chunked data (may be reading the returned response using InputStreams) is more efficient than eliminating it?

Thanks

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

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

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


Chunked response

Posted by Demetris <de...@ece.neu.edu>.
Hi all,

is there a way to configure the server not to returned chunked data? Or 
dealing with the
chunked data (may be reading the returned response using InputStreams) 
is more efficient
than eliminating it?

Thanks

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


Re: AW: POJO return types

Posted by Barry Hathaway <bh...@nycap.rr.com>.
Josef,

Yes we can agree on the definition of serialization/deserialization.

On the client side I was expecting that for each element of a list (or 
an array for that matter) the deserialization
process would be recursively applied until no further deserialization 
was possible. If the list element was an
instance of OMTextImpl then get its text.  If it was an instance of 
OMElement then deserialize it into the list
element. The process might generate another list (in the case of 
List<List<Object>>) or an array (in the case
of a List<Object[]>) which might cause the process to repeat.

I've noticed quite a number of changes in dealing with List and Array 
object from 1.6.0 to 1.7.0 snapshots.
Especially the snapshot behavior seems to change on a daily basis.

Barry

On 8/8/2011 4:01 AM, Stadelmann Josef wrote:
> Barry Hathaway
>
> You write " the list does get created but it's elements are OMElements and are not deserialized. "
>
> My questions:
> What do you expect from the deserialization process?
> Into what larger complex object-type shall your OMElements be deserialized?
>
>
> To understand and agree:
> "  serialization" of an object of some type means "I take the obejct and I make it an (xml-)String"!
> "deserialization" of a (xml-)String should return the object from which the serialized (xml-)String has made!
> No more no less: Can we agree on that?
>
> Now you write:
> the list does get created but its elements are OMElements!
>
> My question is:
> What are you expecting has to be stored in the list?
>
> Josef
>
>
>
>
>
>
>
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Barry Hathaway [mailto:bhathaw1@nycap.rr.com]
> Gesendet: Donnerstag, 4. August 2011 18:02
> An: java-user@axis.apache.org
> Betreff: Re: POJO return types
>
> Sagara,
>
> Perhaps I am doing something wrong; ;however, whenever I try to use a List
> (either as an attribute of a bean or separately) the list does get
> created but its
> elements are OMElements and are not deserialized.  This happens even if I
> declare the list as List<String>.  Also, while I can easily declare a
> list as List<String>
> inside a POJO bean how do I declare a simple return type of type
> List<String>?
> Java seems to only allow "Class[] queryReturnTypes = new Class[] {
> List.class };"
> Thanks.
>
> Barry
>
> On 8/4/2011 11:17 AM, Sagara Gunathunga wrote:
>> On Thu, Aug 4, 2011 at 8:07 PM, Barry Hathaway<bh...@nycap.rr.com>   wrote:
>>> This is good news! I am actually using the snapshot.
>>> Do you have any pointers to documentation that describes how to use these
>>> new features?
>> At the moment there is no such proper documentation exists  but I'm
>> planning to write a tutorial little later. BTW these improvements are
>> much easy to use.
>>
>> For Lists Schema generation and payload is identical to Arrays only
>> run time processing is different. If you have a List as a method
>> parameter or as a field of a POJO Axis2 run time can construct a List
>> object from incoming payload , if the expected parameter or field is
>> an Array  it will construct an array object and use it for invoke the
>> service method.
>>
>> But in client side it is not possible to generate separate codes for
>> both Arrays and Lists using a tool like a WSDL2JAVA, it always
>> generate either Array or List because there is no way to distinguish
>> Arrays and List in Schema. As an example in JAXB by default generate
>> Lists while Axis2 generate Arrays. IMO converting List to a Array or
>> Array to a list is not a big deal.
>>
>>
>> Axis2 Map processing is identical to JAXB Map processing , you can
>> find more information here [1]. Note that Map is specific to Java
>> hence schema generation use custom complex type to represent Maps that
>> results into generate custom Java beans in client side. You can't
>> expect send and receive Java a Maps as it is but need small effort.
>>
>> The best way to explore this is deploy a sample class something
>> similar to below and use SoapUI or WSDL2JAVA in client side. HTH
>>
>> public Map<Integer,String>   simpleMapTest(Map<Integer,String>   map){
>>    SOP(map)
>>    return map;
>> }
>>
>> [1] - http://jaxb.java.net/guide/Mapping_your_favorite_class.html
>>
>> Thanks !
>>
>>
>>> Thanks.
>>>
>>> Barry
>>>
>>> On 8/4/2011 10:14 AM, Sagara Gunathunga wrote:
>>>> On Thu, Aug 4, 2011 at 7:15 AM, Narendra Kadali
>>>> <na...@hotmail.com>     wrote:
>>>>> Hi Barry Hathaway,
>>>>>
>>>>> As far as I know Axis2 aximo data model does not support java collection
>>>>> framework. However one webservice input argument can be declared as List.
>>>> Java Collection and Map support has been implemented on Axis2 trunk
>>>> and will be available with 1.7.0 release until that it's possible to
>>>> use  SNAPSHOT versions if someone really want to utilize these
>>>> features .
>>>>
>>>> Thanks !
>>>>
>>>>> I think the reason behind this is to achieve platform independence.
>>>>>
>>>>> Regards,
>>>>> Narendra
>>>>>
>>>>>> Date: Wed, 3 Aug 2011 17:00:52 -0400
>>>>>> From: bhathaw1@nycap.rr.com
>>>>>> To: java-user@axis.apache.org
>>>>>> Subject: POJO return types
>>>>>>
>>>>>> Since I really didn't have any luck returning Lists or arrays, I decided
>>>>>> to return
>>>>>> a simple POJO class in my POJO web service. The class that I am trying
>>>>>> to return
>>>>>> is defined on both the service and client side as:
>>>>>>
>>>>>> public class QueryResultSet {
>>>>>> private List<Object>     columnNames;
>>>>>> private List<Object>     resultSet;
>>>>>> public QueryResultSet() {
>>>>>> }
>>>>>> public List<Object>     getColumnNames() {
>>>>>> return columnNames;
>>>>>> }
>>>>>> public void setColumnNames(List<Object>     columnNames) {
>>>>>> this.columnNames = columnNames;
>>>>>> }
>>>>>> public List<Object>     getResultSet() {
>>>>>> return resultSet;
>>>>>> }
>>>>>> public void setResultSet(List<Object>     results) {
>>>>>> this.resultSet = results;
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> On the client side, I call the service as:
>>>>>>
>>>>>> Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
>>>>>> try {
>>>>>> Object[] queryResponse =
>>>>>> serviceClient.invokeBlocking(queryQName,
>>>>>> queryArgs, queryReturnTypes);
>>>>>> QueryResultSet rs = (QueryResultSet) queryResponse[0];
>>>>>> List<Object>     colNames = rs.getColumnNames();
>>>>>> List<Object>     queryRows = rs.getResultSet();
>>>>>> for (int i=0; i<colNames.size(); i++) {
>>>>>> log.info("Response from 'query' operation: column name
>>>>>> "+colNames.get(i).toString());
>>>>>> }
>>>>>>
>>>>>> The log statement produces:
>>>>>>
>>>>>> 2011-08-03 16:47:53,059 [main ] INFO
>>>>>> SadlMain - Response from 'query' operation: column
>>>>>> name<ax25:columnNames
>>>>>> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
>>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>> xsi:type="xs:string">cw</ax25:columnNames>
>>>>>>
>>>>>> I was expecting that by specifying the correct return type that the
>>>>>> invokeBlocking call would "unwrap" the
>>>>>> QueryResultSet class in queryResponse[0] and just get cw. Obviously,
>>>>>> being a newbie, this isn't quite right.
>>>>>> Any ideas?
>>>>>>
>>>>>> Thanks
>>>>>> Barry Hathaway
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>>>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
>


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


AW: POJO return types

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Barry Hathaway

You write " the list does get created but it's elements are OMElements and are not deserialized. " 

My questions: 
What do you expect from the deserialization process?
Into what larger complex object-type shall your OMElements be deserialized? 


To understand and agree:
"  serialization" of an object of some type means "I take the obejct and I make it an (xml-)String"!
"deserialization" of a (xml-)String should return the object from which the serialized (xml-)String has made! 
No more no less: Can we agree on that?

Now you write:
the list does get created but its elements are OMElements!

My question is:
What are you expecting has to be stored in the list?

Josef











-----Ursprüngliche Nachricht-----
Von: Barry Hathaway [mailto:bhathaw1@nycap.rr.com] 
Gesendet: Donnerstag, 4. August 2011 18:02
An: java-user@axis.apache.org
Betreff: Re: POJO return types

Sagara,

Perhaps I am doing something wrong; ;however, whenever I try to use a List
(either as an attribute of a bean or separately) the list does get 
created but its
elements are OMElements and are not deserialized.  This happens even if I
declare the list as List<String>.  Also, while I can easily declare a 
list as List<String>
inside a POJO bean how do I declare a simple return type of type 
List<String>?
Java seems to only allow "Class[] queryReturnTypes = new Class[] { 
List.class };"
Thanks.

Barry

On 8/4/2011 11:17 AM, Sagara Gunathunga wrote:
> On Thu, Aug 4, 2011 at 8:07 PM, Barry Hathaway<bh...@nycap.rr.com>  wrote:
>> This is good news! I am actually using the snapshot.
>> Do you have any pointers to documentation that describes how to use these
>> new features?
> At the moment there is no such proper documentation exists  but I'm
> planning to write a tutorial little later. BTW these improvements are
> much easy to use.
>
> For Lists Schema generation and payload is identical to Arrays only
> run time processing is different. If you have a List as a method
> parameter or as a field of a POJO Axis2 run time can construct a List
> object from incoming payload , if the expected parameter or field is
> an Array  it will construct an array object and use it for invoke the
> service method.
>
> But in client side it is not possible to generate separate codes for
> both Arrays and Lists using a tool like a WSDL2JAVA, it always
> generate either Array or List because there is no way to distinguish
> Arrays and List in Schema. As an example in JAXB by default generate
> Lists while Axis2 generate Arrays. IMO converting List to a Array or
> Array to a list is not a big deal.
>
>
> Axis2 Map processing is identical to JAXB Map processing , you can
> find more information here [1]. Note that Map is specific to Java
> hence schema generation use custom complex type to represent Maps that
> results into generate custom Java beans in client side. You can't
> expect send and receive Java a Maps as it is but need small effort.
>
> The best way to explore this is deploy a sample class something
> similar to below and use SoapUI or WSDL2JAVA in client side. HTH
>
> public Map<Integer,String>  simpleMapTest(Map<Integer,String>  map){
>   SOP(map)
>   return map;
> }
>
> [1] - http://jaxb.java.net/guide/Mapping_your_favorite_class.html
>
> Thanks !
>
>
>> Thanks.
>>
>> Barry
>>
>> On 8/4/2011 10:14 AM, Sagara Gunathunga wrote:
>>> On Thu, Aug 4, 2011 at 7:15 AM, Narendra Kadali
>>> <na...@hotmail.com>    wrote:
>>>> Hi Barry Hathaway,
>>>>
>>>> As far as I know Axis2 aximo data model does not support java collection
>>>> framework. However one webservice input argument can be declared as List.
>>> Java Collection and Map support has been implemented on Axis2 trunk
>>> and will be available with 1.7.0 release until that it's possible to
>>> use  SNAPSHOT versions if someone really want to utilize these
>>> features .
>>>
>>> Thanks !
>>>
>>>> I think the reason behind this is to achieve platform independence.
>>>>
>>>> Regards,
>>>> Narendra
>>>>
>>>>> Date: Wed, 3 Aug 2011 17:00:52 -0400
>>>>> From: bhathaw1@nycap.rr.com
>>>>> To: java-user@axis.apache.org
>>>>> Subject: POJO return types
>>>>>
>>>>> Since I really didn't have any luck returning Lists or arrays, I decided
>>>>> to return
>>>>> a simple POJO class in my POJO web service. The class that I am trying
>>>>> to return
>>>>> is defined on both the service and client side as:
>>>>>
>>>>> public class QueryResultSet {
>>>>> private List<Object>    columnNames;
>>>>> private List<Object>    resultSet;
>>>>> public QueryResultSet() {
>>>>> }
>>>>> public List<Object>    getColumnNames() {
>>>>> return columnNames;
>>>>> }
>>>>> public void setColumnNames(List<Object>    columnNames) {
>>>>> this.columnNames = columnNames;
>>>>> }
>>>>> public List<Object>    getResultSet() {
>>>>> return resultSet;
>>>>> }
>>>>> public void setResultSet(List<Object>    results) {
>>>>> this.resultSet = results;
>>>>> }
>>>>> }
>>>>>
>>>>> On the client side, I call the service as:
>>>>>
>>>>> Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
>>>>> try {
>>>>> Object[] queryResponse =
>>>>> serviceClient.invokeBlocking(queryQName,
>>>>> queryArgs, queryReturnTypes);
>>>>> QueryResultSet rs = (QueryResultSet) queryResponse[0];
>>>>> List<Object>    colNames = rs.getColumnNames();
>>>>> List<Object>    queryRows = rs.getResultSet();
>>>>> for (int i=0; i<colNames.size(); i++) {
>>>>> log.info("Response from 'query' operation: column name
>>>>> "+colNames.get(i).toString());
>>>>> }
>>>>>
>>>>> The log statement produces:
>>>>>
>>>>> 2011-08-03 16:47:53,059 [main ] INFO
>>>>> SadlMain - Response from 'query' operation: column
>>>>> name<ax25:columnNames
>>>>> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>> xsi:type="xs:string">cw</ax25:columnNames>
>>>>>
>>>>> I was expecting that by specifying the correct return type that the
>>>>> invokeBlocking call would "unwrap" the
>>>>> QueryResultSet class in queryResponse[0] and just get cw. Obviously,
>>>>> being a newbie, this isn't quite right.
>>>>> Any ideas?
>>>>>
>>>>> Thanks
>>>>> Barry Hathaway
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>
>


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


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


Re: POJO return types

Posted by Barry Hathaway <bh...@nycap.rr.com>.
Sagara,

Perhaps I am doing something wrong; ;however, whenever I try to use a List
(either as an attribute of a bean or separately) the list does get 
created but its
elements are OMElements and are not deserialized.  This happens even if I
declare the list as List<String>.  Also, while I can easily declare a 
list as List<String>
inside a POJO bean how do I declare a simple return type of type 
List<String>?
Java seems to only allow "Class[] queryReturnTypes = new Class[] { 
List.class };"
Thanks.

Barry

On 8/4/2011 11:17 AM, Sagara Gunathunga wrote:
> On Thu, Aug 4, 2011 at 8:07 PM, Barry Hathaway<bh...@nycap.rr.com>  wrote:
>> This is good news! I am actually using the snapshot.
>> Do you have any pointers to documentation that describes how to use these
>> new features?
> At the moment there is no such proper documentation exists  but I'm
> planning to write a tutorial little later. BTW these improvements are
> much easy to use.
>
> For Lists Schema generation and payload is identical to Arrays only
> run time processing is different. If you have a List as a method
> parameter or as a field of a POJO Axis2 run time can construct a List
> object from incoming payload , if the expected parameter or field is
> an Array  it will construct an array object and use it for invoke the
> service method.
>
> But in client side it is not possible to generate separate codes for
> both Arrays and Lists using a tool like a WSDL2JAVA, it always
> generate either Array or List because there is no way to distinguish
> Arrays and List in Schema. As an example in JAXB by default generate
> Lists while Axis2 generate Arrays. IMO converting List to a Array or
> Array to a list is not a big deal.
>
>
> Axis2 Map processing is identical to JAXB Map processing , you can
> find more information here [1]. Note that Map is specific to Java
> hence schema generation use custom complex type to represent Maps that
> results into generate custom Java beans in client side. You can't
> expect send and receive Java a Maps as it is but need small effort.
>
> The best way to explore this is deploy a sample class something
> similar to below and use SoapUI or WSDL2JAVA in client side. HTH
>
> public Map<Integer,String>  simpleMapTest(Map<Integer,String>  map){
>   SOP(map)
>   return map;
> }
>
> [1] - http://jaxb.java.net/guide/Mapping_your_favorite_class.html
>
> Thanks !
>
>
>> Thanks.
>>
>> Barry
>>
>> On 8/4/2011 10:14 AM, Sagara Gunathunga wrote:
>>> On Thu, Aug 4, 2011 at 7:15 AM, Narendra Kadali
>>> <na...@hotmail.com>    wrote:
>>>> Hi Barry Hathaway,
>>>>
>>>> As far as I know Axis2 aximo data model does not support java collection
>>>> framework. However one webservice input argument can be declared as List.
>>> Java Collection and Map support has been implemented on Axis2 trunk
>>> and will be available with 1.7.0 release until that it's possible to
>>> use  SNAPSHOT versions if someone really want to utilize these
>>> features .
>>>
>>> Thanks !
>>>
>>>> I think the reason behind this is to achieve platform independence.
>>>>
>>>> Regards,
>>>> Narendra
>>>>
>>>>> Date: Wed, 3 Aug 2011 17:00:52 -0400
>>>>> From: bhathaw1@nycap.rr.com
>>>>> To: java-user@axis.apache.org
>>>>> Subject: POJO return types
>>>>>
>>>>> Since I really didn't have any luck returning Lists or arrays, I decided
>>>>> to return
>>>>> a simple POJO class in my POJO web service. The class that I am trying
>>>>> to return
>>>>> is defined on both the service and client side as:
>>>>>
>>>>> public class QueryResultSet {
>>>>> private List<Object>    columnNames;
>>>>> private List<Object>    resultSet;
>>>>> public QueryResultSet() {
>>>>> }
>>>>> public List<Object>    getColumnNames() {
>>>>> return columnNames;
>>>>> }
>>>>> public void setColumnNames(List<Object>    columnNames) {
>>>>> this.columnNames = columnNames;
>>>>> }
>>>>> public List<Object>    getResultSet() {
>>>>> return resultSet;
>>>>> }
>>>>> public void setResultSet(List<Object>    results) {
>>>>> this.resultSet = results;
>>>>> }
>>>>> }
>>>>>
>>>>> On the client side, I call the service as:
>>>>>
>>>>> Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
>>>>> try {
>>>>> Object[] queryResponse =
>>>>> serviceClient.invokeBlocking(queryQName,
>>>>> queryArgs, queryReturnTypes);
>>>>> QueryResultSet rs = (QueryResultSet) queryResponse[0];
>>>>> List<Object>    colNames = rs.getColumnNames();
>>>>> List<Object>    queryRows = rs.getResultSet();
>>>>> for (int i=0; i<colNames.size(); i++) {
>>>>> log.info("Response from 'query' operation: column name
>>>>> "+colNames.get(i).toString());
>>>>> }
>>>>>
>>>>> The log statement produces:
>>>>>
>>>>> 2011-08-03 16:47:53,059 [main ] INFO
>>>>> SadlMain - Response from 'query' operation: column
>>>>> name<ax25:columnNames
>>>>> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>> xsi:type="xs:string">cw</ax25:columnNames>
>>>>>
>>>>> I was expecting that by specifying the correct return type that the
>>>>> invokeBlocking call would "unwrap" the
>>>>> QueryResultSet class in queryResponse[0] and just get cw. Obviously,
>>>>> being a newbie, this isn't quite right.
>>>>> Any ideas?
>>>>>
>>>>> Thanks
>>>>> Barry Hathaway
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>
>


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


Re: POJO return types

Posted by Sagara Gunathunga <sa...@gmail.com>.
On Thu, Aug 4, 2011 at 8:07 PM, Barry Hathaway <bh...@nycap.rr.com> wrote:
> This is good news! I am actually using the snapshot.
> Do you have any pointers to documentation that describes how to use these
> new features?

At the moment there is no such proper documentation exists  but I'm
planning to write a tutorial little later. BTW these improvements are
much easy to use.

For Lists Schema generation and payload is identical to Arrays only
run time processing is different. If you have a List as a method
parameter or as a field of a POJO Axis2 run time can construct a List
object from incoming payload , if the expected parameter or field is
an Array  it will construct an array object and use it for invoke the
service method.

But in client side it is not possible to generate separate codes for
both Arrays and Lists using a tool like a WSDL2JAVA, it always
generate either Array or List because there is no way to distinguish
Arrays and List in Schema. As an example in JAXB by default generate
Lists while Axis2 generate Arrays. IMO converting List to a Array or
Array to a list is not a big deal.


Axis2 Map processing is identical to JAXB Map processing , you can
find more information here [1]. Note that Map is specific to Java
hence schema generation use custom complex type to represent Maps that
results into generate custom Java beans in client side. You can't
expect send and receive Java a Maps as it is but need small effort.

The best way to explore this is deploy a sample class something
similar to below and use SoapUI or WSDL2JAVA in client side. HTH

public Map<Integer,String> simpleMapTest(Map<Integer,String> map){
 SOP(map)
 return map;
}

[1] - http://jaxb.java.net/guide/Mapping_your_favorite_class.html

Thanks !


> Thanks.
>
> Barry
>
> On 8/4/2011 10:14 AM, Sagara Gunathunga wrote:
>>
>> On Thu, Aug 4, 2011 at 7:15 AM, Narendra Kadali
>> <na...@hotmail.com>  wrote:
>>>
>>> Hi Barry Hathaway,
>>>
>>> As far as I know Axis2 aximo data model does not support java collection
>>> framework. However one webservice input argument can be declared as List.
>>
>> Java Collection and Map support has been implemented on Axis2 trunk
>> and will be available with 1.7.0 release until that it's possible to
>> use  SNAPSHOT versions if someone really want to utilize these
>> features .
>>
>> Thanks !
>>
>>> I think the reason behind this is to achieve platform independence.
>>>
>>> Regards,
>>> Narendra
>>>
>>>> Date: Wed, 3 Aug 2011 17:00:52 -0400
>>>> From: bhathaw1@nycap.rr.com
>>>> To: java-user@axis.apache.org
>>>> Subject: POJO return types
>>>>
>>>> Since I really didn't have any luck returning Lists or arrays, I decided
>>>> to return
>>>> a simple POJO class in my POJO web service. The class that I am trying
>>>> to return
>>>> is defined on both the service and client side as:
>>>>
>>>> public class QueryResultSet {
>>>> private List<Object>  columnNames;
>>>> private List<Object>  resultSet;
>>>> public QueryResultSet() {
>>>> }
>>>> public List<Object>  getColumnNames() {
>>>> return columnNames;
>>>> }
>>>> public void setColumnNames(List<Object>  columnNames) {
>>>> this.columnNames = columnNames;
>>>> }
>>>> public List<Object>  getResultSet() {
>>>> return resultSet;
>>>> }
>>>> public void setResultSet(List<Object>  results) {
>>>> this.resultSet = results;
>>>> }
>>>> }
>>>>
>>>> On the client side, I call the service as:
>>>>
>>>> Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
>>>> try {
>>>> Object[] queryResponse =
>>>> serviceClient.invokeBlocking(queryQName,
>>>> queryArgs, queryReturnTypes);
>>>> QueryResultSet rs = (QueryResultSet) queryResponse[0];
>>>> List<Object>  colNames = rs.getColumnNames();
>>>> List<Object>  queryRows = rs.getResultSet();
>>>> for (int i=0; i<colNames.size(); i++) {
>>>> log.info("Response from 'query' operation: column name
>>>> "+colNames.get(i).toString());
>>>> }
>>>>
>>>> The log statement produces:
>>>>
>>>> 2011-08-03 16:47:53,059 [main ] INFO
>>>> SadlMain - Response from 'query' operation: column
>>>> name<ax25:columnNames
>>>> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xsi:type="xs:string">cw</ax25:columnNames>
>>>>
>>>> I was expecting that by specifying the correct return type that the
>>>> invokeBlocking call would "unwrap" the
>>>> QueryResultSet class in queryResponse[0] and just get cw. Obviously,
>>>> being a newbie, this isn't quite right.
>>>> Any ideas?
>>>>
>>>> Thanks
>>>> Barry Hathaway
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>



-- 
Sagara Gunathunga

Blog      - http://ssagara.blogspot.com
Web      - http://people.apache.org/~sagara/
LinkedIn - http://www.linkedin.com/in/ssagara

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


Re: POJO return types

Posted by Barry Hathaway <bh...@nycap.rr.com>.
This is good news! I am actually using the snapshot.
Do you have any pointers to documentation that describes how to use 
these new features?
Thanks.

Barry

On 8/4/2011 10:14 AM, Sagara Gunathunga wrote:
> On Thu, Aug 4, 2011 at 7:15 AM, Narendra Kadali
> <na...@hotmail.com>  wrote:
>> Hi Barry Hathaway,
>>
>> As far as I know Axis2 aximo data model does not support java collection
>> framework. However one webservice input argument can be declared as List.
> Java Collection and Map support has been implemented on Axis2 trunk
> and will be available with 1.7.0 release until that it's possible to
> use  SNAPSHOT versions if someone really want to utilize these
> features .
>
> Thanks !
>
>> I think the reason behind this is to achieve platform independence.
>>
>> Regards,
>> Narendra
>>
>>> Date: Wed, 3 Aug 2011 17:00:52 -0400
>>> From: bhathaw1@nycap.rr.com
>>> To: java-user@axis.apache.org
>>> Subject: POJO return types
>>>
>>> Since I really didn't have any luck returning Lists or arrays, I decided
>>> to return
>>> a simple POJO class in my POJO web service. The class that I am trying
>>> to return
>>> is defined on both the service and client side as:
>>>
>>> public class QueryResultSet {
>>> private List<Object>  columnNames;
>>> private List<Object>  resultSet;
>>> public QueryResultSet() {
>>> }
>>> public List<Object>  getColumnNames() {
>>> return columnNames;
>>> }
>>> public void setColumnNames(List<Object>  columnNames) {
>>> this.columnNames = columnNames;
>>> }
>>> public List<Object>  getResultSet() {
>>> return resultSet;
>>> }
>>> public void setResultSet(List<Object>  results) {
>>> this.resultSet = results;
>>> }
>>> }
>>>
>>> On the client side, I call the service as:
>>>
>>> Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
>>> try {
>>> Object[] queryResponse =
>>> serviceClient.invokeBlocking(queryQName,
>>> queryArgs, queryReturnTypes);
>>> QueryResultSet rs = (QueryResultSet) queryResponse[0];
>>> List<Object>  colNames = rs.getColumnNames();
>>> List<Object>  queryRows = rs.getResultSet();
>>> for (int i=0; i<colNames.size(); i++) {
>>> log.info("Response from 'query' operation: column name
>>> "+colNames.get(i).toString());
>>> }
>>>
>>> The log statement produces:
>>>
>>> 2011-08-03 16:47:53,059 [main ] INFO
>>> SadlMain - Response from 'query' operation: column
>>> name<ax25:columnNames
>>> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:type="xs:string">cw</ax25:columnNames>
>>>
>>> I was expecting that by specifying the correct return type that the
>>> invokeBlocking call would "unwrap" the
>>> QueryResultSet class in queryResponse[0] and just get cw. Obviously,
>>> being a newbie, this isn't quite right.
>>> Any ideas?
>>>
>>> Thanks
>>> Barry Hathaway
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>
>
>


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


Re: POJO return types

Posted by Sagara Gunathunga <sa...@gmail.com>.
On Thu, Aug 4, 2011 at 7:15 AM, Narendra Kadali
<na...@hotmail.com> wrote:
> Hi Barry Hathaway,
>
> As far as I know Axis2 aximo data model does not support java collection
> framework. However one webservice input argument can be declared as List.

Java Collection and Map support has been implemented on Axis2 trunk
and will be available with 1.7.0 release until that it's possible to
use  SNAPSHOT versions if someone really want to utilize these
features .

Thanks !

>
> I think the reason behind this is to achieve platform independence.
>
> Regards,
> Narendra
>
>> Date: Wed, 3 Aug 2011 17:00:52 -0400
>> From: bhathaw1@nycap.rr.com
>> To: java-user@axis.apache.org
>> Subject: POJO return types
>>
>> Since I really didn't have any luck returning Lists or arrays, I decided
>> to return
>> a simple POJO class in my POJO web service. The class that I am trying
>> to return
>> is defined on both the service and client side as:
>>
>> public class QueryResultSet {
>> private List<Object> columnNames;
>> private List<Object> resultSet;
>> public QueryResultSet() {
>> }
>> public List<Object> getColumnNames() {
>> return columnNames;
>> }
>> public void setColumnNames(List<Object> columnNames) {
>> this.columnNames = columnNames;
>> }
>> public List<Object> getResultSet() {
>> return resultSet;
>> }
>> public void setResultSet(List<Object> results) {
>> this.resultSet = results;
>> }
>> }
>>
>> On the client side, I call the service as:
>>
>> Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
>> try {
>> Object[] queryResponse =
>> serviceClient.invokeBlocking(queryQName,
>> queryArgs, queryReturnTypes);
>> QueryResultSet rs = (QueryResultSet) queryResponse[0];
>> List<Object> colNames = rs.getColumnNames();
>> List<Object> queryRows = rs.getResultSet();
>> for (int i=0; i<colNames.size(); i++) {
>> log.info("Response from 'query' operation: column name
>> "+colNames.get(i).toString());
>> }
>>
>> The log statement produces:
>>
>> 2011-08-03 16:47:53,059 [main ] INFO
>> SadlMain - Response from 'query' operation: column
>> name <ax25:columnNames
>> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:type="xs:string">cw</ax25:columnNames>
>>
>> I was expecting that by specifying the correct return type that the
>> invokeBlocking call would "unwrap" the
>> QueryResultSet class in queryResponse[0] and just get cw. Obviously,
>> being a newbie, this isn't quite right.
>> Any ideas?
>>
>> Thanks
>> Barry Hathaway
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>



-- 
Sagara Gunathunga

Blog      - http://ssagara.blogspot.com
Web      - http://people.apache.org/~sagara/
LinkedIn - http://www.linkedin.com/in/ssagara

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


RE: POJO return types

Posted by Narendra Kadali <na...@hotmail.com>.
Hi Barry Hathaway,
 
As far as I know Axis2 aximo data model does not support java collection framework. However one webservice input argument can be declared as List.
 
I think the reason behind this is to achieve platform independence.
 
Regards,
Narendra
 

> Date: Wed, 3 Aug 2011 17:00:52 -0400
> From: bhathaw1@nycap.rr.com
> To: java-user@axis.apache.org
> Subject: POJO return types
> 
> Since I really didn't have any luck returning Lists or arrays, I decided 
> to return
> a simple POJO class in my POJO web service. The class that I am trying 
> to return
> is defined on both the service and client side as:
> 
> public class QueryResultSet {
> private List<Object> columnNames;
> private List<Object> resultSet;
> public QueryResultSet() {
> }
> public List<Object> getColumnNames() {
> return columnNames;
> }
> public void setColumnNames(List<Object> columnNames) {
> this.columnNames = columnNames;
> }
> public List<Object> getResultSet() {
> return resultSet;
> }
> public void setResultSet(List<Object> results) {
> this.resultSet = results;
> }
> }
> 
> On the client side, I call the service as:
> 
> Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
> try {
> Object[] queryResponse = 
> serviceClient.invokeBlocking(queryQName,
> queryArgs, queryReturnTypes);
> QueryResultSet rs = (QueryResultSet) queryResponse[0];
> List<Object> colNames = rs.getColumnNames();
> List<Object> queryRows = rs.getResultSet();
> for (int i=0; i<colNames.size(); i++) {
> log.info("Response from 'query' operation: column name 
> "+colNames.get(i).toString());
> }
> 
> The log statement produces:
> 
> 2011-08-03 16:47:53,059 [main ] INFO 
> SadlMain - Response from 'query' operation: column 
> name <ax25:columnNames 
> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd" 
> xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:type="xs:string">cw</ax25:columnNames>
> 
> I was expecting that by specifying the correct return type that the 
> invokeBlocking call would "unwrap" the
> QueryResultSet class in queryResponse[0] and just get cw. Obviously, 
> being a newbie, this isn't quite right.
> Any ideas?
> 
> Thanks
> Barry Hathaway
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
 		 	   		  

Re: POJO return types

Posted by Barry Hathaway <bh...@nycap.rr.com>.
I would have thought the deserialization process would have gone deeper 
into the bean.
Anyway, how do you iterate through the list and deserialize each OMElement?
I tried using BeanUtil.deserialize, but just got null back.
Thanks.

Barry

On 8/3/2011 7:29 PM, Deepal Jayasinghe wrote:
> Hi Barry,
> Now I understand the issue, in the service you have specified the
> columnNames as List<Object>, so when Axis2 to desalinize XML to Object
> it creates an OMelement. So what you get is correct, if you need more
> specific data types then use the correct generics (e.g., List<String>)
>
> Thanks
> Deepal
>> Deepal,
>>
>> That was a good article.  You give two ways of calling invokeBlocking.
>> I'll give the first way a try tomorrow; however, the second way
>> (specifying a return type)
>> is exactly what I am doing.  It does seem to create my bean, but does
>> not deserialize it
>> properly prior to calling the setters.
>> Thanks.
>>
>> Barry
>>
>> On 8/3/2011 5:09 PM, Deepal Jayasinghe wrote:
>>> Have a look at the following article, it might throw some lights:
>>>
>>> http://wso2.org/library/articles/working-rpcserviceclient
>>>
>>> Deepal
>>>
>>> On Wed, Aug 3, 2011 at 5:00 PM, Barry
>>> Hathaway<bh...@nycap.rr.com>   wrote:
>>>> Since I really didn't have any luck returning Lists or arrays, I
>>>> decided to
>>>> return
>>>> a simple POJO class in my POJO web service.  The class that I am
>>>> trying to
>>>> return
>>>> is defined on both the service and client side as:
>>>>
>>>>      public class QueryResultSet {
>>>>          private List<Object>   columnNames;
>>>>          private List<Object>   resultSet;
>>>>          public QueryResultSet() {
>>>>          }
>>>>          public List<Object>   getColumnNames() {
>>>>              return columnNames;
>>>>          }
>>>>          public void setColumnNames(List<Object>   columnNames) {
>>>>              this.columnNames = columnNames;
>>>>          }
>>>>          public List<Object>   getResultSet() {
>>>>              return resultSet;
>>>>          }
>>>>          public void setResultSet(List<Object>   results) {
>>>>              this.resultSet = results;
>>>>          }
>>>>      }
>>>>
>>>> On the client side, I call the service as:
>>>>
>>>>          Class[] queryReturnTypes = new Class[] {
>>>> QueryResultSet.class };
>>>>          try {
>>>>              Object[] queryResponse =
>>>> serviceClient.invokeBlocking(queryQName,
>>>>                      queryArgs, queryReturnTypes);
>>>>              QueryResultSet rs = (QueryResultSet) queryResponse[0];
>>>>              List<Object>   colNames = rs.getColumnNames();
>>>>              List<Object>   queryRows = rs.getResultSet();
>>>>              for (int i=0; i<colNames.size(); i++) {
>>>>                  log.info("Response from 'query' operation: column name
>>>> "+colNames.get(i).toString());
>>>>              }
>>>>
>>>> The log statement produces:
>>>>
>>>> 2011-08-03 16:47:53,059 [main           ] INFO  SadlMain
>>>>     - Response from 'query' operation: column name<ax25:columnNames
>>>> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xsi:type="xs:string">cw</ax25:columnNames>
>>>>
>>>> I was expecting that by specifying the correct return type that the
>>>> invokeBlocking call would "unwrap" the
>>>> QueryResultSet class in queryResponse[0] and just get cw.
>>>> Obviously, being
>>>> a newbie, this isn't quite right.
>>>> Any ideas?
>>>>
>>>> Thanks
>>>> Barry Hathaway
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
>


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


Re: POJO return types

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Barry,
Now I understand the issue, in the service you have specified the
columnNames as List<Object>, so when Axis2 to desalinize XML to Object
it creates an OMelement. So what you get is correct, if you need more
specific data types then use the correct generics (e.g., List<String>) 

Thanks
Deepal
> Deepal,
>
> That was a good article.  You give two ways of calling invokeBlocking.
> I'll give the first way a try tomorrow; however, the second way
> (specifying a return type)
> is exactly what I am doing.  It does seem to create my bean, but does
> not deserialize it
> properly prior to calling the setters.
> Thanks.
>
> Barry
>
> On 8/3/2011 5:09 PM, Deepal Jayasinghe wrote:
>> Have a look at the following article, it might throw some lights:
>>
>> http://wso2.org/library/articles/working-rpcserviceclient
>>
>> Deepal
>>
>> On Wed, Aug 3, 2011 at 5:00 PM, Barry
>> Hathaway<bh...@nycap.rr.com>  wrote:
>>> Since I really didn't have any luck returning Lists or arrays, I
>>> decided to
>>> return
>>> a simple POJO class in my POJO web service.  The class that I am
>>> trying to
>>> return
>>> is defined on both the service and client side as:
>>>
>>>     public class QueryResultSet {
>>>         private List<Object>  columnNames;
>>>         private List<Object>  resultSet;
>>>         public QueryResultSet() {
>>>         }
>>>         public List<Object>  getColumnNames() {
>>>             return columnNames;
>>>         }
>>>         public void setColumnNames(List<Object>  columnNames) {
>>>             this.columnNames = columnNames;
>>>         }
>>>         public List<Object>  getResultSet() {
>>>             return resultSet;
>>>         }
>>>         public void setResultSet(List<Object>  results) {
>>>             this.resultSet = results;
>>>         }
>>>     }
>>>
>>> On the client side, I call the service as:
>>>
>>>         Class[] queryReturnTypes = new Class[] {
>>> QueryResultSet.class };
>>>         try {
>>>             Object[] queryResponse =
>>> serviceClient.invokeBlocking(queryQName,
>>>                     queryArgs, queryReturnTypes);
>>>             QueryResultSet rs = (QueryResultSet) queryResponse[0];
>>>             List<Object>  colNames = rs.getColumnNames();
>>>             List<Object>  queryRows = rs.getResultSet();
>>>             for (int i=0; i<colNames.size(); i++) {
>>>                 log.info("Response from 'query' operation: column name
>>> "+colNames.get(i).toString());
>>>             }
>>>
>>> The log statement produces:
>>>
>>> 2011-08-03 16:47:53,059 [main           ] INFO  SadlMain
>>>    - Response from 'query' operation: column name<ax25:columnNames
>>> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:type="xs:string">cw</ax25:columnNames>
>>>
>>> I was expecting that by specifying the correct return type that the
>>> invokeBlocking call would "unwrap" the
>>> QueryResultSet class in queryResponse[0] and just get cw. 
>>> Obviously, being
>>> a newbie, this isn't quite right.
>>> Any ideas?
>>>
>>> Thanks
>>> Barry Hathaway
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

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


Re: POJO return types

Posted by Barry Hathaway <bh...@nycap.rr.com>.
Deepal,

That was a good article.  You give two ways of calling invokeBlocking.
I'll give the first way a try tomorrow; however, the second way 
(specifying a return type)
is exactly what I am doing.  It does seem to create my bean, but does 
not deserialize it
properly prior to calling the setters.
Thanks.

Barry

On 8/3/2011 5:09 PM, Deepal Jayasinghe wrote:
> Have a look at the following article, it might throw some lights:
>
> http://wso2.org/library/articles/working-rpcserviceclient
>
> Deepal
>
> On Wed, Aug 3, 2011 at 5:00 PM, Barry Hathaway<bh...@nycap.rr.com>  wrote:
>> Since I really didn't have any luck returning Lists or arrays, I decided to
>> return
>> a simple POJO class in my POJO web service.  The class that I am trying to
>> return
>> is defined on both the service and client side as:
>>
>>     public class QueryResultSet {
>>         private List<Object>  columnNames;
>>         private List<Object>  resultSet;
>>         public QueryResultSet() {
>>         }
>>         public List<Object>  getColumnNames() {
>>             return columnNames;
>>         }
>>         public void setColumnNames(List<Object>  columnNames) {
>>             this.columnNames = columnNames;
>>         }
>>         public List<Object>  getResultSet() {
>>             return resultSet;
>>         }
>>         public void setResultSet(List<Object>  results) {
>>             this.resultSet = results;
>>         }
>>     }
>>
>> On the client side, I call the service as:
>>
>>         Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
>>         try {
>>             Object[] queryResponse = serviceClient.invokeBlocking(queryQName,
>>                     queryArgs, queryReturnTypes);
>>             QueryResultSet rs = (QueryResultSet) queryResponse[0];
>>             List<Object>  colNames = rs.getColumnNames();
>>             List<Object>  queryRows = rs.getResultSet();
>>             for (int i=0; i<colNames.size(); i++) {
>>                 log.info("Response from 'query' operation: column name
>> "+colNames.get(i).toString());
>>             }
>>
>> The log statement produces:
>>
>> 2011-08-03 16:47:53,059 [main           ] INFO  SadlMain
>>    - Response from 'query' operation: column name<ax25:columnNames
>> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:type="xs:string">cw</ax25:columnNames>
>>
>> I was expecting that by specifying the correct return type that the
>> invokeBlocking call would "unwrap" the
>> QueryResultSet class in queryResponse[0] and just get cw.  Obviously, being
>> a newbie, this isn't quite right.
>> Any ideas?
>>
>> Thanks
>> Barry Hathaway
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>
>


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


Re: POJO return types

Posted by Deepal Jayasinghe <de...@gmail.com>.
Have a look at the following article, it might throw some lights:

http://wso2.org/library/articles/working-rpcserviceclient

Deepal

On Wed, Aug 3, 2011 at 5:00 PM, Barry Hathaway <bh...@nycap.rr.com> wrote:
> Since I really didn't have any luck returning Lists or arrays, I decided to
> return
> a simple POJO class in my POJO web service.  The class that I am trying to
> return
> is defined on both the service and client side as:
>
>    public class QueryResultSet {
>        private List<Object> columnNames;
>        private List<Object> resultSet;
>        public QueryResultSet() {
>        }
>        public List<Object> getColumnNames() {
>            return columnNames;
>        }
>        public void setColumnNames(List<Object> columnNames) {
>            this.columnNames = columnNames;
>        }
>        public List<Object> getResultSet() {
>            return resultSet;
>        }
>        public void setResultSet(List<Object> results) {
>            this.resultSet = results;
>        }
>    }
>
> On the client side, I call the service as:
>
>        Class[] queryReturnTypes = new Class[] { QueryResultSet.class };
>        try {
>            Object[] queryResponse = serviceClient.invokeBlocking(queryQName,
>                    queryArgs, queryReturnTypes);
>            QueryResultSet rs = (QueryResultSet) queryResponse[0];
>            List<Object> colNames = rs.getColumnNames();
>            List<Object> queryRows = rs.getResultSet();
>            for (int i=0; i<colNames.size(); i++) {
>                log.info("Response from 'query' operation: column name
> "+colNames.get(i).toString());
>            }
>
> The log statement produces:
>
> 2011-08-03 16:47:53,059 [main           ] INFO  SadlMain
>   - Response from 'query' operation: column name <ax25:columnNames
> xmlns:ax25="http://provider.axis.sadlserver.sadl.research.ge.com/xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="xs:string">cw</ax25:columnNames>
>
> I was expecting that by specifying the correct return type that the
> invokeBlocking call would "unwrap" the
> QueryResultSet class in queryResponse[0] and just get cw.  Obviously, being
> a newbie, this isn't quite right.
> Any ideas?
>
> Thanks
> Barry Hathaway
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>



-- 
http://blogs.deepal.org

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