none
WCF service contract design with more than 100 operations RRS feed

  • General discussion

  • Hi

    I have multiple interfaces with 10 methods in each, i want to expose those methods to be consumed by other client over web or network.

    If i define each interface as service contract, i have to provide multiple end points to clients to access them

    to provide only one endpoint to access from client, Do I need to create single service contract or is there any alternative way of achieving.

    If i create multiple services,  i have to create multiple proxy objects in client and validation and operation synchroniaton issue will come.

    Can you suggest, what is the best way of designing service contract with 100 operations and exposed with single end point ( clients knows only 1 proxy with single endpoint)

    Thanks

    Wednesday, August 30, 2017 7:51 AM

All replies

  • You could look into a Service Layer.

    https://msdn.microsoft.com/en-us/library/ee658090.aspx?f=255&MSPPError=-2147217396

    You could look into a using a WebAPI with the WCF services sitting behind the WebAPI. And all the client sees is the Service Layer.

    Or the client sees the WebAPI  with the WebAPI consuming the Service Layer and the SL consuming the WCF Services, which is never seen by the client.

    Wednesday, August 30, 2017 11:16 AM
  • thank you for your reply and suggestion.

    WCF also provides routing service where i can handle all incoming traffic and route by making multiple wcf services.

    but still in web api, and routing service should have all methods in single CLASS, which i dont want.

    I am looking for if client has to create a Proxy to call those service methods, proxy should have minimum number of operations than entire 100 operations.

    Is it OK to design with single CLASS with 100 operations which are called by Clients or any best solution we can think off


    Prabhakar

    Wednesday, August 30, 2017 11:35 AM
  • but still in web api, and routing service should have all methods in single CLASS, which i dont want.

    That is not correct. One can have multiple controllers in a WebApi solution, which are CLASSES.

    WebAPI sitting in front of multiple services with well over 40 of them, a controller for each service 40 or more endpoints.

    Wednesday, August 30, 2017 11:50 AM
  • Thanks but client has to call each operation only right? not class object right?

    Ex: i have calculator class with ADD MUL DIV SUB kind of operations

    client has to know all methods and call four methods from client, not as single method. Here i am not able to reduce total methods.

    Is it OK to call a single method from client thick client WPF, by passing what method i want to execute on server 

    client uses Execute( method, parameters) 

      Excute(ADD, a,b); Excute(DIV, a,b), 

    So that my interface contains single method Execute, but there i can use any number of objects.

    like that we can design? as appropriate? any issues


    Prabhakar

    Thursday, August 31, 2017 8:06 AM
  • Is it OK to call a single method from client thick client WPF, by passing what method i want to execute on server 

    If one is using a service that's on a network LAN or WAN, then how can the client machine be a thick anything? The application on the machine would be a thick application if the front-end client and backend were on the same machine.

    And no you can't be passing something into the service as to what Operational contract  is to be used. You have to know what Operational contract the WCF is exposing publicly on IService Interface.

    So that my interface contains single method Execute, but there i can use any number of objects.

    like that we can design? as appropriate? any issues

    No, an Operational contact must know a knowntype to return.

    You can't be going cowboy gunslinger in the wild wild West just making things up.

    Thursday, August 31, 2017 12:22 PM