I need to write a wrapper for a collection of web methods that display in a specific web service. It makes sense to stick with this new wrapper method in the same service, since it affects an object of the same type.
Most of these web methods are just subtle methods that invoke static methods in other files, which is good, but they also have some security logic that runs before calling static methods. Instead of re-creating the security logic before each method call that I want to wrap, is it possible to just call these other web methods from within the same service locally or is it bad practice?
Here is an example:
[WebMethod]
public int SmallMethod1(int a)
{
return AnObject.StaticMethod1();
}
[WebMethod]
public int SmallMethod2(int b)
{
return AnObject.StaticMethod2();
}
[WebMethod]
public int WrapperMethod(int c)
{
return AnObject.StaticMethod1() + AnObject.StaticMethod2();
}