I need to write a wrapper for a collection of web methods that are exposed in a particular web service. It makes sense to stick this new wrapper method in the same service since it's affecting the same type of object.
Most of these web methods are just thin methods which call static methods in other files, which is fine, but they also have some security logic done before these static method calls. Rather than recreate the security logic before each method call I want to wrap, is it possible to just call these other web methods from inside the same service locally, or is this bad practice?
Here's an example:
[WebMethod]
public int SmallMethod1(int a)
{
//SecurityLogic
return AnObject.StaticMethod1();
}
[WebMethod]
public int SmallMethod2(int b)
{
//SecurityLogic
return AnObject.StaticMethod2();
}
[WebMethod]
public int WrapperMethod(int c)
{
return AnObject.StaticMethod1() + AnObject.StaticMethod2();
}