Featured post
c# - WCF multiple named pipe endpoints -
i have 2 services want interact through named pipes. tried 2 ways, both creating 2 separate servicehosts, , creating multiple endpoints on single service. first service works whether have second service or not. second service in both cases, either endpoint not found error due not finding named pipe (separate services) or address filter problem (which setting not fix). i've checked , double checked settings, i'm stumped.
both server , client both use same assembly has contract:
[servicecontract(callbackcontract = typeof(iservicecallback1), sessionmode = sessionmode.required)] public interface iservice1 { .... } [servicecontract] public interface iservice2 { ... }
here's server side:
[servicebehavior(instancecontextmode = instancecontextmode.persession, concurrencymode = concurrencymode.reentrant, includeexceptiondetailinfaults = true)] class service1impl : iservice1 { ... } [servicebehavior(instancecontextmode = instancecontextmode.persession, includeexceptiondetailinfaults = true)] class iservice2impl : iservice2 { ... } ... servicehost1 = new servicehost(typeof(service1impl)); servicehost2 = new servicehost(typeof(service2impl)); try { servicehost2.open(); servicehost1.open(); }
(yes, open them in opposite order, since client process assumes service2 available if can connect service1)
here's configuration services:
<system.servicemodel> <services> <service name="service1impl" behaviorconfiguration="myservicebehavior"> <endpoint address="" binding="netnamedpipebinding" contract="iservice1"/> <host> <baseaddresses> <add baseaddress="net.pipe://localhost/service1"/> </baseaddresses> </host> </service> <service name="service2impl" behaviorconfiguration="myservicebehavior"> <endpoint address="" binding="netnamedpipebinding" contract="iservice2"/> <host> <baseaddresses> <add baseaddress="net.pipe://localhost/service2"/> </baseaddresses> </host> </service> </services> <behaviors> <servicebehaviors> <behavior name="myservicebehavior"> <servicedebug includeexceptiondetailinfaults="true"/> </behavior> </servicebehaviors> </behaviors> </system.servicemodel>
client-side don't use configuration , use both:
public class service2client: clientbase<iservice2>, iservice2 { public service2client() : base(new netnamedpipebinding(), new endpointaddress("net.pipe://localhost/service2")) { } }
is there i'm missing here? said, can connect , make calls on first service fine, second gets endpointnotfoundexception complaining couldn't find named pipe.
- Get link
- X
- Other Apps
Comments
Post a Comment