snellspace : a perfect world spoiled by reality


Thursday, January 31, 2002

Judgement over how much overhead is in the .NET example is purely a matter of perspective.  If I look at it strictly from a scripting point of view, there are about six items of extra information that may not be strictly necessary.  I count in that number the following items:

  1. <%@ WebService Language="C#" Class="Hello" %>
  2. using System.Web.Services;
  3. [WebService(Namespace="urn:Hello")]
  4. [ WebMethod ]
  5. The return data type (string) on the method
  6. The parameter data type on the method

Compare the .NET version to the Perl version and the differences stick out very clearly.  And yes, it was much easier to write this simple example using Perl.  And I don't even like Perl.

From the point of view of somebody who is used to working in non-scripting, type-safe languages, however, I see hardly any unnecessary overhead in the .NET sample.  In fact, from this perspective, the Perl version leaves much to be desired.

So which is the vest environment to create Web services?  Scripting or non-scripting? Who cares, just write the code you need to write.  If a scripting language does what you need it to do, knock your socks off.  If a non-scripting environment works better for you, code away.  Both have their respective advantages and disadvantages.


1:59:59 PM    

Wow, this is getting much better discussion than I had imagined...

Simon Fell writes: Sjoerd's example doesn't specify the namespace URI, come on guys post some thing that's (a) equivilent to the other examples, (b) is callable by the sample client code. Some of those lines of overhead are nothing to do with web services but just the fact that C# is a OO language.

Dave does have a point.  In a very real sense, the only logic in this example is:

"Hello " + name

One could imagine a system in which this information, placed in a file named "/webservice/Hello/sayHello" would do everything necessary to be callable by the sample client code.

[Sam Ruby's Radio Weblog]
1:26:05 PM    

Web Service Interop  I can't work out why James didn't setup the .NET endpoint to be the same at the other endpoints, that way a single peice of client code could of called all 3 without changes. All it should take is adding the SoapRpcMethod attribute to the sayHello method. [Simon Fell]

Because even I learn something new every day ;-)  So the SoapRpcMethod attribute takes care of this? Great, ok, let me write that down.  I must admit that when it comes to .NET, I'm not as familiar as I should be, my nose has been deep into Java Web Service architectural issues for the past year. 


10:33:05 AM    

Read this article on Web Services interop. It's an eye-opener because they include sample code for a web service in .NET. Look at all the overhead. Did they really design an environment for web services? If so what are all those magic incantations about?   [Scripting News]
8:57:48 AM    

James Snell: Web Services Interoperability. The fundamental goal of interoperability in Web services is to blur the lines between the various development environments.  Agreed. [Sam Ruby's Radio Weblog]
8:55:40 AM    



Copyright © 2002 James Snell.
Last update: 6/25/2002; 9:48:25 PM.
The views and opinions expressed on this site are solely those of the author, James Snell, and not necessarily of James' employer.