First drop available of the ChannelManagement library. Currently only support single action channels, meaning that after executing the operation the channel is closed. I hope to add pooling the coming week.
The zip contains the source code and an example project. Not much changes in the ‘end user’ code:
static void Main(string[] args) { var myService = ContextRegistry.GetContext().GetObject("MyService") as IService1; string value = myService.GetData(5); var returnValue = myService.GetDataUsingDataContract(new CompositeType() { BoolValue = false, StringValue = "Perponcher" }); Console.ReadLine(); } |
<spring> <context> <resource uri="config://spring/objects" /> </context> <objects xmlns="http://www.springframework.net"> <object id="MyService" type="WCFChannelManager.ChannelManagerFactoryObject, Perponcher.WCFChannelManager"> <property name="ChannelType" expression="T(Server.IService1, Common)"/> <property name="EndpointConfigurationName" value="MyEndpoint"/> </object> </objects> </spring> <system.serviceModel> <client> <endpoint name="MyEndpoint" address="http://localhost:8731/Design_Time_Addresses/Server/Service1/" contract="Server.IService1" binding ="wsHttpBinding"/> </client> </system.serviceModel> |
Out and ref parameters are not yet supported.
WCFChannelManager.zip (1.17 mb)
Series: