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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -