Request for design guideline on parameter

Discussion in 'ASP .Net Web Services' started by Louis Yeung, Apr 6, 2005.

  1. Louis Yeung

    Louis Yeung Guest

    Hi,

    I am going around circles on the use of parameters in Web Service. I believe
    that the parameters should be of primitive type for Web Service interop. If
    my method expects 2 input parms (say int and string), modifies them and
    returns them to call, how should I define the Web service method in C#? Any
    Pro and Con (especially on Interop).

    Please remember I am not going after a Web service or else debate. I just
    need to know the catch in the following solutions and best practice from
    everyone.

    1. public void method(ref int in1, ref string in2)
    I like this one because it is like RPC and with interop in my own mind.

    2. public ClassA method(int in1, string in2) where ClassA {int in1; string
    in2;}
    Some of our people is against byref in web service method. Your opinion? I
    feel this ClassA is redundant. Can interop be an issue when "class" is being
    passed around?

    3. public string method(int in1, string in2) where string is a XML of the
    output
    I personally feel like undoing some of the provided plumbing. We have to
    decode again.

    My starting point may not be 100% correct because the SOA model recommends
    you define the Web Service XSD first to ensure interop and develop the Web
    service based on the definition. This is why I am keeping to primitive types,
    no class.
     
    Louis Yeung, Apr 6, 2005
    #1
    1. Advertising

  2. I see you have not received any answers yet, so let me jump in.

    I use ByRef arguments all the time in web services. In fact, I also use
    custom classes as parameters in web services, without any problems.

    However, I'm not sure what you mean by "web service interop" so I may be a
    bit off-track here.

    ---Selden


    "Louis Yeung" <> wrote in message
    news:...
    > Hi,
    >
    > I am going around circles on the use of parameters in Web Service. I
    > believe
    > that the parameters should be of primitive type for Web Service interop.
    > If
    > my method expects 2 input parms (say int and string), modifies them and
    > returns them to call, how should I define the Web service method in C#?
    > Any
    > Pro and Con (especially on Interop).
    >
    > Please remember I am not going after a Web service or else debate. I just
    > need to know the catch in the following solutions and best practice from
    > everyone.
    >
    > 1. public void method(ref int in1, ref string in2)
    > I like this one because it is like RPC and with interop in my own mind.
    >
    > 2. public ClassA method(int in1, string in2) where ClassA {int in1; string
    > in2;}
    > Some of our people is against byref in web service method. Your opinion? I
    > feel this ClassA is redundant. Can interop be an issue when "class" is
    > being
    > passed around?
    >
    > 3. public string method(int in1, string in2) where string is a XML of the
    > output
    > I personally feel like undoing some of the provided plumbing. We have to
    > decode again.
    >
    > My starting point may not be 100% correct because the SOA model recommends
    > you define the Web Service XSD first to ensure interop and develop the Web
    > service based on the definition. This is why I am keeping to primitive
    > types,
    > no class.
    >
    >
    >
    >
     
    Selden McCabe, Apr 12, 2005
    #2
    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. John Salerno

    style guideline for naming variables?

    John Salerno, Mar 17, 2006, in forum: Python
    Replies:
    2
    Views:
    275
    Duncan Smith
    Mar 18, 2006
  2. Vyom

    macro style guideline

    Vyom, Nov 21, 2004, in forum: C Programming
    Replies:
    7
    Views:
    321
    Dan Pop
    Nov 23, 2004
  3. lovecreatesbeauty

    Redundant behavior in coding guideline

    lovecreatesbeauty, Oct 27, 2005, in forum: C Programming
    Replies:
    0
    Views:
    403
    lovecreatesbeauty
    Oct 27, 2005
  4. lovecreatesbeauty

    Redundant behavior in coding guideline

    lovecreatesbeauty, Oct 27, 2005, in forum: C Programming
    Replies:
    2
    Views:
    332
    Netocrat
    Oct 27, 2005
  5. lovecreatesbeauty
    Replies:
    17
    Views:
    598
    Jordan Abel
    Jan 1, 2006
Loading...

Share This Page