H
H
Hoobert2012-06-18 14:00:48
.NET
Hoobert, 2012-06-18 14:00:48

How to divide a web service into classes?

There is a certain application which communicates with a web service. This application supports loading plugins that can also access the web service.
Problem: the web service class contains both methods of the main application, like “get the user of the application”, and completely left-handed methods for plugins like “get the list of organizers of an event in a certain city”.
I want to separate flies from cutlets and not dump everything in one class, but I don’t want to publish separate services for each plugin.
I tried a variant with namespaces, like this:

[ServiceContract(Namespace = "http://organisation.ru/basicoperations")]
public interface IBasicOperations
...
[ServiceContract(Namespace = "http://organisation.ru/extendedoperations")]
public interface IExtendedOperations
...

On the client, this method allows you to achieve what you want - several clients for one service are automatically generated there, but on the server everything still falls into one class. it implements all interfaces.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
neru, 2012-06-18
@neru

You want to eat a fish and not sit down on anything :))))
Then write one method with one input parameter of the System.Object type and parsing this economy inside for further reflection (as an option) and calling the necessary methods of the necessary classes with the necessary parameters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question