wcf-configuration

WCF: Configuring Known Types

淺唱寂寞╮ 提交于 2019-11-27 09:18:45
I want to know as to how to configure known types in WCF. For example, I have a Person class and an Employee class. The Employee class is a sublass of the Person class. Both class are marked with a [DataContract] attribute. I dont want to hardcode the known type of a class, like putting a [ServiceKnownType(typeof(Employee))] at the Person class so that WCF will know that Employee is a subclass of Person. Now, I added to the host's App.config the following XML configuration: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.runtime.serialization> <dataContractSerializer>

WCF ConcurrencyMode Single and InstanceContextMode PerCall

空扰寡人 提交于 2019-11-27 04:31:13
问题 I have an issue with my wcf service config. I would like every call to my service create a new instance of the service. For the concurrency I would like to one call is finished before another start. Thus if I have a service like this one: [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Single, InstanceContextMode=InstanceContextMode.PerCall)] public class MyService: IMyService { public bool MyServiceOp() { Debug.WriteLine("thread "+ Thread.CurrentThread.ManagedThreadId.ToString()); Debug

How do you configure WCF known types programmatically?

落爺英雄遲暮 提交于 2019-11-26 18:27:47
My client/server application is using WCF for communication, which has been great. However one shortcoming of the current architecture is that I must use known type configuration for certain transmitted types. I'm using an in-house Pub/Sub mechanism and this requirement is unavoidable. The problem is that it's easy to forget to add the known type, and if you do, WCF fails silently with few clues as to what's going wrong. In my application, I know the set of types that are going to be sent. I would like to perform the configuration programmatically, rather than declaratively through the App

Service has zero application (non-infrastructure) endpoints

自古美人都是妖i 提交于 2019-11-26 18:09:56
问题 I recently created a WCF service (dll) and a service host (exe). I know my WCF service is working correctly since I am able to successfully add the service to WcfTestClient. However, I seem to be running into an issue when I comes to utlizing my WCF from a service host (exe). I can add a reference to the WCF (dll) to my service host (exe) and create the necessary componets to the exe; such as the service installer, service host, and the app.config, compile and then finally install the exe

WCF: Configuring Known Types

只愿长相守 提交于 2019-11-26 14:38:11
问题 I want to know as to how to configure known types in WCF. For example, I have a Person class and an Employee class. The Employee class is a sublass of the Person class. Both class are marked with a [DataContract] attribute. I dont want to hardcode the known type of a class, like putting a [ServiceKnownType(typeof(Employee))] at the Person class so that WCF will know that Employee is a subclass of Person. Now, I added to the host's App.config the following XML configuration: <?xml version="1.0