Creating a custom [WebMethod] attribute

Discussion in 'ASP .Net Web Services' started by Dustyg, Jan 19, 2006.

  1. Dustyg

    Dustyg Guest

    I have a webservice with several stubbed out methods and severl
    implemented methods. We are releasing to prod with a beta version
    allowing customer to use the implemented methods but I would like to
    hide the stubbed out methods (and some implemented methods we don't
    want seen) from the wsdl. But I would like this to be done from a
    config file so when we do want to release the other implemented methods
    there is no recompiling needed.

    - Putting them in another asmx files is not an option.
    - Setting up authorization to limit use is already implemented, I just
    don't want the methods seen.


    Is it possible to create a custom attribute which performs the same
    functionality (exposing the method in a webservice) as [WebMethod]?

    Thank you
     
    Dustyg, Jan 19, 2006
    #1
    1. Advertising

  2. Why don't you just remove the <Webmethod()> attribute from the the
    functions/subs that you don't want to be seen yet?
    as soon as they are implemented you can just put the method-attribute back
    in place.

    HTH
    Friso Wiskerke


    "Dustyg" <> wrote in message
    news:...
    >I have a webservice with several stubbed out methods and severl
    > implemented methods. We are releasing to prod with a beta version
    > allowing customer to use the implemented methods but I would like to
    > hide the stubbed out methods (and some implemented methods we don't
    > want seen) from the wsdl. But I would like this to be done from a
    > config file so when we do want to release the other implemented methods
    > there is no recompiling needed.
    >
    > - Putting them in another asmx files is not an option.
    > - Setting up authorization to limit use is already implemented, I just
    > don't want the methods seen.
    >
    >
    > Is it possible to create a custom attribute which performs the same
    > functionality (exposing the method in a webservice) as [WebMethod]?
    >
    > Thank you
    >
     
    Friso Wiskerke, Jan 24, 2006
    #2
    1. Advertising

  3. Dustyg

    Dustyg Guest

    As I stated, we don't want to remove the [WebMethod] attribute because
    we don't want to have to push the code every time we release a new
    method. Changing a value in a config file would better suite our
    needs.

    Thank you

    - Dustin
     
    Dustyg, Jan 24, 2006
    #3
  4. Maybe the [Conditional] attribute can help you out?


    "Dustyg" <> wrote in message
    news:...
    > As I stated, we don't want to remove the [WebMethod] attribute because
    > we don't want to have to push the code every time we release a new
    > method. Changing a value in a config file would better suite our
    > needs.
    >
    > Thank you
    >
    > - Dustin
    >
     
    Friso Wiskerke, Jan 25, 2006
    #4
  5. Dustyg

    Dustyg Guest

    The [Conditional] attribute relies on the definition of a compilation
    symbol, meaning the defined symbol is compiled and cannot be changed
    without re-compiling. It also only ignores calls to the method rather
    than removing them from compilation like a directive in C++ would so it
    would still show up in the wsdl.
     
    Dustyg, Jan 25, 2006
    #5
    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. CMM

    Custom Test Page for WebMethod

    CMM, Mar 19, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    468
  2. Dave
    Replies:
    0
    Views:
    451
  3. Matt
    Replies:
    1
    Views:
    150
  4. Matt Bush

    Serializing custom exception through a webmethod call.

    Matt Bush, Nov 9, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    215
    Dan Rogers
    Nov 11, 2004
  5. Andy Fish

    using the [WebMethod(MessageName="...")] attribute

    Andy Fish, Mar 16, 2006, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    269
Loading...

Share This Page