c# - Multiple wcf services in one implementation -
i have 2 interfaces:
[servicecontract(callbackcontract = typeof(iremoteplayer), sessionmode = sessionmode.required)] public interface iremoteplaybackctrl { [operationcontract(isoneway = false, isinitiating = true)] bool signin(guid id, string key, int number); } [servicecontract(callbackcontract = typeof(iremotestreamer), sessionmode = sessionmode.required)] public interface iremotestreamerctrl { [operationcontract(isoneway = false, isinitiating = true)] bool registerstreamer(); } both implemented in single class. need create wcf service self-host , nettcpbinding endpoints on ports 9001 , 9002 (or single port 9001 if possible). both services duplex , using sessions. configuration file is:
<configuration> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5" /> </startup> <system.servicemodel> <services> <service behaviorconfiguration="svcbehavior" name="ctrlsvcself.sl.player.remotectrl"> <endpoint address="net.tcp://localhost:9001/streamctrl" binding="nettcpbinding" contract="remote.iremotestreamerctrl" /> <endpoint address="mex" binding="mextcpbinding" contract="imetadataexchange" /> <host> <baseaddresses> <add baseaddress="net.tcp://localhost:9001/streamctrl" /> </baseaddresses> </host> </service> </services> <behaviors> <servicebehaviors> <behavior name="svcbehavior"> <servicemetadata httpgetenabled="false"/> </behavior> </servicebehaviors> </behaviors> </system.servicemodel> </configuration> it works fine. how can modify configuration file needed result? thanks!
Comments
Post a Comment