Re: Big-Picture Question (Web Services, RegNow)
- From: "Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx>
- Date: Sat, 18 Nov 2006 14:33:10 -0700
Laurent,
The constraints for web methods are exactly the same as for "normal"
methods: One return value only, but it can be anything including array (if
you have many "fields" of the same type), or an object including different
properties.
That's interesting. I tried using out parameters but the VS 2005 testing
mechanism for asmx files does not support that. I just tried returning a
string array. This is supported. Unfortunately, there is no way to name each
of the string fields returned.
However, if you can, I recommend to keep it simple. First you'll avoid
serialization problems, and second, remember that web services clients are
not only C#, but could be anything, including JavaScript (it's quite easy
to make a web service call using JavaScript). For example, instead of
transmitting a DateTime object, why not transmit a string representation
of that DateTime... you get the idea.
Yes, and I agree wholeheartedly. However, I'm writing a service that
provides a registration code for my software. It seems like it would be more
straightforward (and more standard?) to include two return values: One that
indicate success or failure, and another that provides the registration code
(or error message on failure).
I don't want to do anything that is out of the ordinary but it seems like
this would be a good, simple approach, one for which XML is well suited. If
this is not at all standard, I could include a pass/fail string at the start
of my return string. But only seems like it would be harder for the consumer
of my Web service to deal with.
Thanks!
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
.
- Follow-Ups:
- Re: Big-Picture Question (Web Services, RegNow)
- From: Laurent Bugnion
- Re: Big-Picture Question (Web Services, RegNow)
- References:
- Big-Picture Question (Web Services, RegNow)
- From: Jonathan Wood
- Re: Big-Picture Question (Web Services, RegNow)
- From: Mark Rae
- Re: Big-Picture Question (Web Services, RegNow)
- From: Jonathan Wood
- Re: Big-Picture Question (Web Services, RegNow)
- From: Laurent Bugnion
- Big-Picture Question (Web Services, RegNow)
- Prev by Date: Re: Inline
- Next by Date: Re: Big-Picture Question (Web Services, RegNow)
- Previous by thread: Re: Big-Picture Question (Web Services, RegNow)
- Next by thread: Re: Big-Picture Question (Web Services, RegNow)
- Index(es):
Relevant Pages
|
Loading