Is it possible to split a webservice to more files?
I’m writing a webservice in C# and rum under Linux with Mono. Now it already has about 80 webmethod and the file is not transparent and very large.
How can I split/separate the webservice methods to more file so that the server looks one unit from outside ( for clients)?
I’ve tried this in python too (ladon webservice), but I can’t find any way to split it.
Please help somebody,
Thanks
Perhaps you could break up the web service class into partial classes – this would at least allow you to break up this big service into smaller parts. Aim for each partial to have a single responsibility.
You could also refactor the service so that the service endpoint contains just the 80 web methods but all the code that each function used to contain is now encapsulated in an appropriate class
eg:
becomes
So the 80 webmethods are just stubs for calls to the classes that do the work = each class is manageable and you don’t break the service contract with your clients.