Why are properties not available in WebService?

Discussion in 'ASP .Net Web Services' started by Paul Liebrand, Feb 9, 2004.

  1. Can someone tell me (or point me to documentation) that explains why Properties are not available in WebService?
     
    Paul Liebrand, Feb 9, 2004
    #1
    1. Advertising

  2. It's probably due to the statelessness of the Web.

    One solution might be to create a class with all the properties you want on
    the client side, and just pass that whole class into the webservice. It
    could then get whatever state data it needs from that class and do it's
    thing. I think I'd just suggest passing all of yoru arguments into each
    method though.

    Michael

    "Paul Liebrand" <> wrote in message
    news:D...
    > Can someone tell me (or point me to documentation) that explains why

    Properties are not available in WebService?


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.573 / Virus Database: 363 - Release Date: 1/28/2004
     
    Michael Pearson, Feb 9, 2004
    #2
    1. Advertising

  3. "Paul Liebrand" <> wrote in message
    news:D...
    > Can someone tell me (or point me to documentation) that explains why

    Properties are not available in WebService?

    Are you asking why a WebService cannot expose properties the same way it can
    expose WebMethods?

    Well, I guess in theory the .NET Web services implementation could support
    properties. All it would require is a mapping from the SOAP message on a
    suitable property in the web service proxy class and in the web service
    implementation.

    However, properties make little sense with Web services because they imply
    an object-oriented model, and Web services are not distributed objects.
    There are a couple of issues.

    First, having properties would encourage the design of chatty interfaces:

    double x = webService.X;
    double y = webService.Y;
    double z = webService.Z;

    With this you would get three roundtrips to the server. Instead of chatty,
    you want to do chunky interfaces:

    double[3] xyz = webService.getXYZ();

    Another reason is that properties imply a stateful model:

    webService.Foo = "Foo";
    string foo = webService.Foo;
    Diagnostics.Assert(foo == "Foo");

    Again, this is not exactly what Web services are designed to do. Web
    services typically maintain no state.

    Sami
     
    Sami Vaaraniemi, Feb 9, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Natty Gur
    Replies:
    0
    Views:
    2,605
    Natty Gur
    Jun 6, 2004
  2. =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Replies:
    0
    Views:
    2,413
    =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Jun 7, 2004
  3. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    990
    Mark Rae
    Dec 21, 2006
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,255
    Smokey Grindel
    Dec 2, 2006
  5. laredotornado
    Replies:
    1
    Views:
    1,353
    markspace
    Dec 29, 2009
Loading...

Share This Page