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 Marcos Vilela <vi...@gmail.com> on 2007/03/25 23:49:21 UTC

What to return?

 Hello,

 I'm doing a service here that return rows from a database, like row
Employee with name and id for example. What is the suggestion of you all to
return? It's better to return an Object[] Employee or a long string with
<name>..</name> , <id> ... </id> of all rows in the database return? I would
like to have clients in .NET and Java. Any help on my doubt?

thanks a lot,
Marcos Vilela
-- 
View this message in context: http://www.nabble.com/What-to-return--tf3464060.html#a9664758
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: What to return?

Posted by Philipp Leitner <ph...@gmx.at>.
Then you ae using the Call API ... basically everything in this API 
seems to be depreciated by now (see 
http://ws.apache.org/axis2/0_94/api/org/apache/axis2/client/Call.html) . 
You should really have a look at the ServiceClient API (as in the link 
posted by Martin), and use sendReceive() there. Try to do a 
"System.out.println(omelement)" or similar on the returned element, and 
tell me what you see. Then I can tell you if we both have the same 
troubles :-)

/philipp

Martin Gainty schrieb:
> apologies for the interruption but I found some doc for Phillips suggestion to use org.apache.axis2.client.ServiceClient.sendReceiveNonBlocking
> http://ws.apache.org/axis2/0_95/api/org/apache/axis2/client/ServiceClient.html
> ...
> M
> --------------------------------------------------------------------------- 
> This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
> --------------------------------------------------------------------------- 
> Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
> ----- Original Message ----- 
> From: "Marcos Vilela" <vi...@gmail.com>
> To: <ax...@ws.apache.org>
> Sent: Sunday, March 25, 2007 7:14 PM
> Subject: Re: What to return?
> 
> 
>> Phillip,
>>
>>  I'm using serviceClient.invokeBlocking that's seems to be synchrounous. An
>> Array of object is a complex return type?
>> I'm doing what that POJOs guide tells to do from Axis2 site.  I hope you got
>> what happens with me. do you have MSN or Googletalk?
>>
>> many thanks
>> Marcos Vilela
>> msn: vilelamarcos@hotmail.com
>> googletalk: vilelam@gmail.com
>>
>>
>>
>> Philipp Leitner-2 wrote:
>>> Hmm, I currently have a similar problem. I would be interested in what 
>>> communication style you are using in your client (assuming you are 
>>> speaking from an Axis2 client). Do you use the "sendReceive" (i.e. the 
>>> blocking) communication or the asynchronous "sendReceiveNonBlocking" ?
>>>
>>> Interestingly enough I seem to have troubles with the blocking variant 
>>> and complex return types, while the asychnchronous variant works without 
>>> problems ...
>>>
>>> /philipp
>>>
>>> Marcos Vilela schrieb:
>>>> Phillipp, nice to have your point of view. Actually everything started
>>>> because I was trying to send an Array[] of Employee and in my client I
>>>> was
>>>> getting only the first element on the array. So the natural way is return
>>>> the object right? I will try to make something to make my client works to
>>>> get all elements in the array.  
>>>>
>>>>
>>>> my Service has method that returns Employee[]
>>>>
>>>> And I'm doing my client this way:
>>>>
>>>> import javax.xml.namespace.QName;
>>>> import org.apache.axis2.AxisFault;
>>>> import org.apache.axis2.addressing.EndpointReference;
>>>> import org.apache.axis2.client.Options;
>>>> import org.apache.axis2.rpc.client.RPCServiceClient;
>>>>
>>>> // Getting Employee
>>>> QName opGetWeather =
>>>>     new QName("http://service.pojo.sample/xsd", "testQuery");
>>>>
>>>> Object[] opGetWeatherArgs = new Object[] { };
>>>> Class[] returnTypes = new Class[] { Employee.class };
>>>>
>>>> Object[] response = serviceClient.invokeBlocking(opGetWeather,
>>>>         opGetWeatherArgs, returnTypes);
>>>>
>>>> response has always only one element. Probably there are other ways to do
>>>> the client. I'm looking to use OMElement.
>>>>
>>>> Do you have any suggest?
>>>>
>>>> thanks and best regards
>>>> Marcos Vilela
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Philipp Leitner-2 wrote:
>>>>> Returning an array or a list of objects is surely the more natural way 
>>>>> to go, but may in some cases inflict a performance penalty.
>>>>>
>>>>> I would go for the list of objects, and only if you run into severe 
>>>>> performance troubles go for optimizing the solution.
>>>>>
>>>>> /philipp
>>>>>
>>>>> Marcos Vilela schrieb:
>>>>>>  Hello,
>>>>>>
>>>>>>  I'm doing a service here that return rows from a database, like row
>>>>>> Employee with name and id for example. What is the suggestion of you
>>>>>> all
>>>>>> to
>>>>>> return? It's better to return an Object[] Employee or a long string
>>>>>> with
>>>>>> <name>..</name> , <id> ... </id> of all rows in the database return? I
>>>>>> would
>>>>>> like to have clients in .NET and Java. Any help on my doubt?
>>>>>>
>>>>>> thanks a lot,
>>>>>> Marcos Vilela
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>>>
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
>>>
>>>
>> -- 
>> View this message in context: http://www.nabble.com/What-to-return--tf3464060.html#a9665463
>> Sent from the Axis - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>

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


Re: What to return?

Posted by Martin Gainty <mg...@hotmail.com>.
apologies for the interruption but I found some doc for Phillips suggestion to use org.apache.axis2.client.ServiceClient.sendReceiveNonBlocking
http://ws.apache.org/axis2/0_95/api/org/apache/axis2/client/ServiceClient.html
...
M
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Marcos Vilela" <vi...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Sunday, March 25, 2007 7:14 PM
Subject: Re: What to return?


> 
> Phillip,
> 
>  I'm using serviceClient.invokeBlocking that's seems to be synchrounous. An
> Array of object is a complex return type?
> I'm doing what that POJOs guide tells to do from Axis2 site.  I hope you got
> what happens with me. do you have MSN or Googletalk?
> 
> many thanks
> Marcos Vilela
> msn: vilelamarcos@hotmail.com
> googletalk: vilelam@gmail.com
> 
> 
> 
> Philipp Leitner-2 wrote:
>> 
>> Hmm, I currently have a similar problem. I would be interested in what 
>> communication style you are using in your client (assuming you are 
>> speaking from an Axis2 client). Do you use the "sendReceive" (i.e. the 
>> blocking) communication or the asynchronous "sendReceiveNonBlocking" ?
>> 
>> Interestingly enough I seem to have troubles with the blocking variant 
>> and complex return types, while the asychnchronous variant works without 
>> problems ...
>> 
>> /philipp
>> 
>> Marcos Vilela schrieb:
>>> Phillipp, nice to have your point of view. Actually everything started
>>> because I was trying to send an Array[] of Employee and in my client I
>>> was
>>> getting only the first element on the array. So the natural way is return
>>> the object right? I will try to make something to make my client works to
>>> get all elements in the array.  
>>> 
>>> 
>>> my Service has method that returns Employee[]
>>> 
>>> And I'm doing my client this way:
>>> 
>>> import javax.xml.namespace.QName;
>>> import org.apache.axis2.AxisFault;
>>> import org.apache.axis2.addressing.EndpointReference;
>>> import org.apache.axis2.client.Options;
>>> import org.apache.axis2.rpc.client.RPCServiceClient;
>>> 
>>> // Getting Employee
>>> QName opGetWeather =
>>>     new QName("http://service.pojo.sample/xsd", "testQuery");
>>> 
>>> Object[] opGetWeatherArgs = new Object[] { };
>>> Class[] returnTypes = new Class[] { Employee.class };
>>> 
>>> Object[] response = serviceClient.invokeBlocking(opGetWeather,
>>>         opGetWeatherArgs, returnTypes);
>>> 
>>> response has always only one element. Probably there are other ways to do
>>> the client. I'm looking to use OMElement.
>>> 
>>> Do you have any suggest?
>>> 
>>> thanks and best regards
>>> Marcos Vilela
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Philipp Leitner-2 wrote:
>>>> Returning an array or a list of objects is surely the more natural way 
>>>> to go, but may in some cases inflict a performance penalty.
>>>>
>>>> I would go for the list of objects, and only if you run into severe 
>>>> performance troubles go for optimizing the solution.
>>>>
>>>> /philipp
>>>>
>>>> Marcos Vilela schrieb:
>>>>>  Hello,
>>>>>
>>>>>  I'm doing a service here that return rows from a database, like row
>>>>> Employee with name and id for example. What is the suggestion of you
>>>>> all
>>>>> to
>>>>> return? It's better to return an Object[] Employee or a long string
>>>>> with
>>>>> <name>..</name> , <id> ... </id> of all rows in the database return? I
>>>>> would
>>>>> like to have clients in .NET and Java. Any help on my doubt?
>>>>>
>>>>> thanks a lot,
>>>>> Marcos Vilela
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>>
>>>>
>>>>
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context: http://www.nabble.com/What-to-return--tf3464060.html#a9665463
> Sent from the Axis - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
>

Re: What to return?

Posted by Marcos Vilela <vi...@gmail.com>.
Phillip,

  I'm using serviceClient.invokeBlocking that's seems to be synchrounous. An
Array of object is a complex return type?
I'm doing what that POJOs guide tells to do from Axis2 site.  I hope you got
what happens with me. do you have MSN or Googletalk?

many thanks
Marcos Vilela
msn: vilelamarcos@hotmail.com
googletalk: vilelam@gmail.com



Philipp Leitner-2 wrote:
> 
> Hmm, I currently have a similar problem. I would be interested in what 
> communication style you are using in your client (assuming you are 
> speaking from an Axis2 client). Do you use the "sendReceive" (i.e. the 
> blocking) communication or the asynchronous "sendReceiveNonBlocking" ?
> 
> Interestingly enough I seem to have troubles with the blocking variant 
> and complex return types, while the asychnchronous variant works without 
> problems ...
> 
> /philipp
> 
> Marcos Vilela schrieb:
>> Phillipp, nice to have your point of view. Actually everything started
>> because I was trying to send an Array[] of Employee and in my client I
>> was
>> getting only the first element on the array. So the natural way is return
>> the object right? I will try to make something to make my client works to
>> get all elements in the array.  
>> 
>> 
>> my Service has method that returns Employee[]
>> 
>> And I'm doing my client this way:
>> 
>> import javax.xml.namespace.QName;
>> import org.apache.axis2.AxisFault;
>> import org.apache.axis2.addressing.EndpointReference;
>> import org.apache.axis2.client.Options;
>> import org.apache.axis2.rpc.client.RPCServiceClient;
>> 
>> // Getting Employee
>> QName opGetWeather =
>>     new QName("http://service.pojo.sample/xsd", "testQuery");
>> 
>> Object[] opGetWeatherArgs = new Object[] { };
>> Class[] returnTypes = new Class[] { Employee.class };
>> 
>> Object[] response = serviceClient.invokeBlocking(opGetWeather,
>>         opGetWeatherArgs, returnTypes);
>> 
>> response has always only one element. Probably there are other ways to do
>> the client. I'm looking to use OMElement.
>> 
>> Do you have any suggest?
>> 
>> thanks and best regards
>> Marcos Vilela
>> 
>> 
>> 
>> 
>> 
>> 
>> Philipp Leitner-2 wrote:
>>> Returning an array or a list of objects is surely the more natural way 
>>> to go, but may in some cases inflict a performance penalty.
>>>
>>> I would go for the list of objects, and only if you run into severe 
>>> performance troubles go for optimizing the solution.
>>>
>>> /philipp
>>>
>>> Marcos Vilela schrieb:
>>>>  Hello,
>>>>
>>>>  I'm doing a service here that return rows from a database, like row
>>>> Employee with name and id for example. What is the suggestion of you
>>>> all
>>>> to
>>>> return? It's better to return an Object[] Employee or a long string
>>>> with
>>>> <name>..</name> , <id> ... </id> of all rows in the database return? I
>>>> would
>>>> like to have clients in .NET and Java. Any help on my doubt?
>>>>
>>>> thanks a lot,
>>>> Marcos Vilela
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
>>>
>>>
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/What-to-return--tf3464060.html#a9665463
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: What to return?

Posted by Philipp Leitner <ph...@gmx.at>.
Hmm, I currently have a similar problem. I would be interested in what 
communication style you are using in your client (assuming you are 
speaking from an Axis2 client). Do you use the "sendReceive" (i.e. the 
blocking) communication or the asynchronous "sendReceiveNonBlocking" ?

Interestingly enough I seem to have troubles with the blocking variant 
and complex return types, while the asychnchronous variant works without 
problems ...

/philipp

Marcos Vilela schrieb:
> Phillipp, nice to have your point of view. Actually everything started
> because I was trying to send an Array[] of Employee and in my client I was
> getting only the first element on the array. So the natural way is return
> the object right? I will try to make something to make my client works to
> get all elements in the array.  
> 
> 
> my Service has method that returns Employee[]
> 
> And I'm doing my client this way:
> 
> import javax.xml.namespace.QName;
> import org.apache.axis2.AxisFault;
> import org.apache.axis2.addressing.EndpointReference;
> import org.apache.axis2.client.Options;
> import org.apache.axis2.rpc.client.RPCServiceClient;
> 
> // Getting Employee
> QName opGetWeather =
>     new QName("http://service.pojo.sample/xsd", "testQuery");
> 
> Object[] opGetWeatherArgs = new Object[] { };
> Class[] returnTypes = new Class[] { Employee.class };
> 
> Object[] response = serviceClient.invokeBlocking(opGetWeather,
>         opGetWeatherArgs, returnTypes);
> 
> response has always only one element. Probably there are other ways to do
> the client. I'm looking to use OMElement.
> 
> Do you have any suggest?
> 
> thanks and best regards
> Marcos Vilela
> 
> 
> 
> 
> 
> 
> Philipp Leitner-2 wrote:
>> Returning an array or a list of objects is surely the more natural way 
>> to go, but may in some cases inflict a performance penalty.
>>
>> I would go for the list of objects, and only if you run into severe 
>> performance troubles go for optimizing the solution.
>>
>> /philipp
>>
>> Marcos Vilela schrieb:
>>>  Hello,
>>>
>>>  I'm doing a service here that return rows from a database, like row
>>> Employee with name and id for example. What is the suggestion of you all
>>> to
>>> return? It's better to return an Object[] Employee or a long string with
>>> <name>..</name> , <id> ... </id> of all rows in the database return? I
>>> would
>>> like to have clients in .NET and Java. Any help on my doubt?
>>>
>>> thanks a lot,
>>> Marcos Vilela
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
> 

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


Re: What to return?

Posted by Marcos Vilela <vi...@gmail.com>.
Phillipp, nice to have your point of view. Actually everything started
because I was trying to send an Array[] of Employee and in my client I was
getting only the first element on the array. So the natural way is return
the object right? I will try to make something to make my client works to
get all elements in the array.  


my Service has method that returns Employee[]

And I'm doing my client this way:

import javax.xml.namespace.QName;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;

// Getting Employee
QName opGetWeather =
    new QName("http://service.pojo.sample/xsd", "testQuery");

Object[] opGetWeatherArgs = new Object[] { };
Class[] returnTypes = new Class[] { Employee.class };

Object[] response = serviceClient.invokeBlocking(opGetWeather,
        opGetWeatherArgs, returnTypes);

response has always only one element. Probably there are other ways to do
the client. I'm looking to use OMElement.

Do you have any suggest?

thanks and best regards
Marcos Vilela






Philipp Leitner-2 wrote:
> 
> Returning an array or a list of objects is surely the more natural way 
> to go, but may in some cases inflict a performance penalty.
> 
> I would go for the list of objects, and only if you run into severe 
> performance troubles go for optimizing the solution.
> 
> /philipp
> 
> Marcos Vilela schrieb:
>>  Hello,
>> 
>>  I'm doing a service here that return rows from a database, like row
>> Employee with name and id for example. What is the suggestion of you all
>> to
>> return? It's better to return an Object[] Employee or a long string with
>> <name>..</name> , <id> ... </id> of all rows in the database return? I
>> would
>> like to have clients in .NET and Java. Any help on my doubt?
>> 
>> thanks a lot,
>> Marcos Vilela
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/What-to-return--tf3464060.html#a9665017
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: What to return?

Posted by Philipp Leitner <ph...@gmx.at>.
Returning an array or a list of objects is surely the more natural way 
to go, but may in some cases inflict a performance penalty.

I would go for the list of objects, and only if you run into severe 
performance troubles go for optimizing the solution.

/philipp

Marcos Vilela schrieb:
>  Hello,
> 
>  I'm doing a service here that return rows from a database, like row
> Employee with name and id for example. What is the suggestion of you all to
> return? It's better to return an Object[] Employee or a long string with
> <name>..</name> , <id> ... </id> of all rows in the database return? I would
> like to have clients in .NET and Java. Any help on my doubt?
> 
> thanks a lot,
> Marcos Vilela

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