473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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 1949
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Daniel Pryde | last post by:
Hi everyone. I was wondering if anyone might be able to help me out here. I'm currently looking to find the quickest way to find a best fit match in a large array. My problem is that I have an...
4
by: Chuck Ritzke | last post by:
I keep asking myself this question as I write class modules. What's the best/smartest/most efficient way to send a large object back and forth to a class module? For example, say I have a data...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
5
by: Tom | last post by:
If I have a container class that has a map member which stores pointers to objects that have been created via the new operator and I have a method that returns a entry in the map, would it be best...
17
by: 2005 | last post by:
Hi In C++, are the following considered best practices or not? - passing aguments to functions (ie functions do not take any arguments ) - returning values using return statement Anything...
5
by: blisspikle | last post by:
I figure that someone good at dotnet can look at this and give me a clue on how to easily organize this code? If there is a unique identifier like "Publisher" with a bunch of "Book" that are...
1
by: Muchach | last post by:
Hello, Ok so what I've got going on is a form that is populated by pulling info from database then using php do{} to create elements in form. I have a text box in each table row for the user to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.