Creating a custom [WebMethod] attribute

D

Dustyg

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
 
F

Friso Wiskerke

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
 
D

Dustyg

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
 
D

Dustyg

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top