470,870 Members | 1,442 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 developers. It's quick & easy.

Best way to return more than one value

I'm interested in writing a web service that will return more than one value.
What's the best way to accomplish this? I was wondering if an array would
be best, but I'd like to know if there is a better way.
Feb 24 '06 #1
4 1858
You probably wan't to be thinking "document/literal" not rpc. Instead
of thinking of returing a primitive || array, think Object. Ideally
Your webservice should take one Object parameter and return
one Object. The return object can contain as many objects/fields/arrays
you require. In short, just create a domain
object with an arraylist, this object will be your return type.
Best regards.
JRadical

"Military Smurf" wrote:
I'm interested in writing a web service that will return more than one value.
What's the best way to accomplish this? I was wondering if an array would
be best, but I'd like to know if there is a better way.

Mar 1 '06 #2
Hi,

I'm supposed to be testing a webservice that is returning more than one
value (An error code and a session id).

The testing tool that I have can't seem to use the webservice because the
session id return value is defined as a ByRef output parameter of the
WebMethod. The error code is returned as the result of calling the WebMethod

The developer is telling me that using output parameters is the best method
of returning two values - do you agree with this ?

I'm confused as to how a remote client can supply a ByRef output parameter
to a WebService. Your solution of building a single object sounds more
logical to me.
"JRadical" wrote:
You probably wan't to be thinking "document/literal" not rpc. Instead
of thinking of returing a primitive || array, think Object. Ideally
Your webservice should take one Object parameter and return
one Object. The return object can contain as many objects/fields/arrays
you require. In short, just create a domain
object with an arraylist, this object will be your return type.
Best regards.
JRadical

"Military Smurf" wrote:
I'm interested in writing a web service that will return more than one value.
What's the best way to accomplish this? I was wondering if an array would
be best, but I'd like to know if there is a better way.

Mar 6 '06 #3
The excellent Web Service Studio handles output (ref and out)
parameters:

http://www.gotdotnet.com/Community/U...4-e916ebc4159c

I would personally avoid using output parameters (particularly in a web
service) and go with adding it to the output body.

Josh
http://www.thejoyofcode.com/

Mar 7 '06 #4
Thanks Josh,

The utility is really helpful.

"Josh Twist" wrote:
The excellent Web Service Studio handles output (ref and out)
parameters:

http://www.gotdotnet.com/Community/U...4-e916ebc4159c

I would personally avoid using output parameters (particularly in a web
service) and go with adding it to the output body.

Josh
http://www.thejoyofcode.com/

Mar 7 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Daniel Pryde | last post: by
136 posts views Thread by Matt Kruse | last post: by
reply views Thread by Anonieko Ramos | last post: by
17 posts views Thread by 2005 | last post: by
1 post views Thread by Muchach | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.