Re: Big-Picture Question (Web Services, RegNow)



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


.



Relevant Pages

  • RE: Ajax AutoCompleteExtender is Auto-Calculating
    ... You must add apostrophe symbol before and after string inserted in web ... service array. ... AutoCompleteExtender is not the data that resides in the database, ... data being returned by the web service the AutoCompleteExtender consumes. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Soap Request containing an array?
    ... that requires input as an array of a particular data structure and I ... public a1 as string ... dim myRequestStructure as new com.xxx.xxx.xxx.etc.RequestStructure ... But, that creates a problem when I get to the actual web service call, ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Web Service method works on local machine but fails on remote
    ... You might be right becasue I chnaged my code to accept a byte array and then ... foreach (byte t in byteArray) ... exception which say unavble to convert a string to byte. ... I have a web service method which works fine when called from my local ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Big-Picture Question (Web Services, RegNow)
    ... I just tried returning a string array. ... there is no way to name each of the string fields returned. ... public ReturnValue GetRegistrationCode() ... But only seems like it would be harder for the consumer of my Web service to deal with. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Soap Request containing an array?
    ... dim MyLocalB as new MyNewClass.MyBStructure ... It looks like the only problem you have is creating an array of structure ... I'm fried on this problem...It's vb.net, dealing with a web service ... public a1 as string ...
    (microsoft.public.dotnet.framework.webservices)

Loading