c# - Now that WebServiceHost2Factory is dead, how do I return error text from a WCF rest service? -
i've seen several references webservicehost2factory class use effectively handle errors in wcf rest services. apparently class, had throw webprotocolexception , body of response contain pertinent information. that class seems have fallen out of favor now. there replacement somewhere in .net 4 stack? i'm trying figure out how return error text in body of response post operation, if went wrong. key question below next *'s example: [description("performs full enroll , activation of member loyalty program")] [operationcontract] [webinvoke(method = "post", uritemplate = "/fullenroll/{clientdeviceid}", bodystyle = webmessagebodystyle.bare, requestformat = webmessageformat.json, responseformat = webmessageformat.json)] public memberinfo fullenroll(string clientdeviceid, fullenrollmentrequest request) { log.debugformat("fullenroll. clientdeviceid: {0}, request:{1}", clientdeviceid, request); memberinfo ret = ...