c# - How to handle 30 request using single wcf operation? -
i bit stuck somewhere while designing solution , therefore need expertise , suggestions.
the problem is: have 30 type of requests each having different parameters therefore treating these 30 request 30 different request input response same request types.
now need create 1 operation inside existing wcf service can cater 30 types of requests.
i not getting how cater within single operation. dont want create 30 operations handle request individually.
if request types derive same type can expose them polymorphically using serviceknowntypes attribute:
[datacontract] [knowntype(typeof(requestfromthisguy))] [knowntype(typeof(requestfromthisotherguy))] public class uberrequest { ... } [datacontract] public class requestfromthisguy: uberrequest { ... } [datacontract] public class requestfromthisotherguy: uberrequest { ... }
then service operation:
[operationcontract] commonresponsetype dosomething (uberrequest request)
Comments
Post a Comment