none
Using WCF client with netTcpBinding to connect to service which on different domain RRS feed

  • Question

  • Hi,

    I am new to WCF concept and a performance tester. I am trying to connect the WCF client to WCF service netTcpBinding on server which is on different domain. This is service is set as discoveryService (called Radio Service)

    Below is the scenario:

    1. WCFClient (clientMachine) and WCFService(serverMachine) is on same domain -- Client is able to connect to service on serverMachine

    2. WCFClient (clientMachine) and WCFService(serverMachine) is on different domain -- Client is NOT able to connect to service on serverMachine

    Below is the service.config:

    <?xml version="1.0" encoding="UTF-8"?> <configuration> <announcementServiceEndpoint discoveryMulticastAddress="soap.udp://239.255.255.250:9896" /> <serviceDiscoveryConfiguration discoveryCheckInterval="00:00:30" /> <system.serviceModel> <client> <endpoint name="udpDiscoveryEndpoint" kind="udpDiscoveryEndpoint" endpointConfiguration="udpDiscoveryEndpointClient" /> <endpoint name="dispatcherService" address="" binding="netTcpBinding" bindingConfiguration="tcpBindingConfig" contract="Server.DispatcherService.IDispatcherService" /> </client> <services> <!-- RadioSvc endpoint for receiving commands for the radio service --> <service name="Server.Radio.RadioService" behaviorConfiguration="RadioServiceBehaviour"> <host> <baseAddresses> <add baseAddress="net.tcp://*:20000" /> </baseAddresses> <timeouts openTimeout="00:01:00" closeTimeout="00:00:10" /> </host> <endpoint address="" binding="netTcpBinding" bindingConfiguration="tcpBindingConfig" contract="Northgate.CallTouch.Server.Radio.IRadioService" behaviorConfiguration="DynamicContactBehaviour" /> <endpoint kind="udpDiscoveryEndpoint" endpointConfiguration="udpDiscoveryEndpointSvc" /> </service> <service name="Radio.Web.RadioService" behaviorConfiguration="RadioApiServiceBehaviour"> <host> <baseAddresses> <add baseAddress="http://*:20001" /> </baseAddresses> <timeouts openTimeout="00:01:00" closeTimeout="00:00:10" /> </host> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <endpoint address="web" binding="basicHttpBinding" name="web" contract="Server.Radio.Web.IRadioService" bindingConfiguration="basicHttpBinding" behaviorConfiguration="WebEndpointBehaviour" /> </service> </services> <bindings> <netTcpBinding> <binding name="tcpBindingConfig" receiveTimeout="00:10:00" sendTimeout="00:00:08" openTimeout="00:00:08" maxReceivedMessageSize="4194304" maxBufferSize="4194304"> <security mode="None" /> </binding> </netTcpBinding> <basicHttpBinding> <binding name="basicHttpBinding"> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name="RadioServiceBehaviour"> <!--<monitoredRadioServiceBehaviour/>--> <standaloneRadioServiceBehaviour /> <!--<xslt serviceTransform="RadioServiceTransforms.xslt" callbackTransform="RadioServiceCallbackTransforms.xslt"/>--> <serviceDiscovery> <announcementEndpoints> <endpoint kind="udpAnnouncementEndpoint" endpointConfiguration="udpAnnouncementEndpointSettings" /> </announcementEndpoints> </serviceDiscovery> </behavior> <behavior name="RadioApiServiceBehaviour"> <standaloneRadioServiceBehaviour /> <serviceMetadata httpGetEnabled="True" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name="WebEndpointBehaviour"> <dynamicDataContractEndpointBehaviour assemblyQueryString="*abc.dll" /> <sessionEndpointBehaviour /> </behavior> <behavior name="DynamicContactBehaviour"> <dynamicDataContractEndpointBehaviour assemblyQueryString="*abc.dll" /> </behavior> </endpointBehaviors> </behaviors> <standardEndpoints> <udpDiscoveryEndpoint> <standardEndpoint name="udpDiscoveryEndpointSvc" maxResponseDelay="00:00:00.800" multicastAddress="soap.udp://239.255.255.250:9996"> <transportSettings timeToLive="1" /> </standardEndpoint> <standardEndpoint name="udpDiscoveryEndpointClient" maxResponseDelay="00:00:00.800" multicastAddress="soap.udp://239.255.255.250:9896"> <transportSettings timeToLive="1" /> </standardEndpoint> </udpDiscoveryEndpoint> <udpAnnouncementEndpoint> <standardEndpoint name="udpAnnouncementEndpointSettings" maxAnnouncementDelay="00:00:00.800" multicastAddress="soap.udp://239.255.255.250:9996"> <transportSettings timeToLive="1" /> </standardEndpoint> </udpAnnouncementEndpoint> </standardEndpoints> </system.serviceModel> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /> </startup> </configuration>

    Below is the Client.config:

    <?xml version="1.0" encoding="UTF-8"?>

    <configuration> <announcementServiceEndpoint discoveryMulticastAddress="soap.udp://239.255.255.250:9996" /> <system.serviceModel> <!-- Enable Instrumentation --> <diagnostics wmiProviderEnabled="true"> <messageLogging logEntireMessage="false" logMalformedMessages="false" logMessagesAtServiceLevel="false" logMessagesAtTransportLevel="false" maxMessagesToLog="3000" maxSizeOfMessageToLog="2000" /> </diagnostics> <extensions> <behaviorExtensions> <add name="dynamicDataContractEndpointBehaviour" type="Common.Utilities.Messaging.DynamicDataContractEndpointBehaviourElement, Utilities" /> </behaviorExtensions> </extensions> <!-- Bindings --> <bindings> <!-- TCP --> <netTcpBinding> <binding name="TCPBinding" receiveTimeout="00:10:00" sendTimeout="00:00:08" openTimeout="00:00:08" maxReceivedMessageSize="4194304" maxBufferSize="4194304"> <security mode="None" /> </binding> </netTcpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="DynamicDataEndpoint"> <dynamicDataContractEndpointBehaviour assemblyQueryString="*Providers.dll" /> </behavior> </endpointBehaviors> </behaviors> <!-- WCF Service Settings --> <client> <endpoint name="discoveryEndpointConfigurationName" kind="udpDiscoveryEndpoint" endpointConfiguration="udpDiscoveryEndpoint" /> <endpoint name="radioService" address="" binding="netTcpBinding" bindingConfiguration="TCPBinding" contract="Server.Radio.IRadioService" behaviorConfiguration="DynamicDataEndpoint" /> </client> <standardEndpoints> <udpDiscoveryEndpoint> <standardEndpoint name="udpDiscoveryEndpoint" maxResponseDelay="00:00:00.800" multicastAddress="soap.udp://239.255.255.250:9996"> <transportSettings timeToLive="1" /> </standardEndpoint> </udpDiscoveryEndpoint> </standardEndpoints> </system.serviceModel> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /> </startup> </configuration>

    Can anyone help on what needs to be changed either on server's service config or client config in order client can connect for scenario 2 mentioned above.

    Both machines are in same network but on different domain. I can not change the domain of either server or client machine.

    Please help !!!

    Thanks,

    Kushal.

    Friday, April 28, 2017 2:20 PM

All replies

  • To check whether it is related with FireWall, i suggest you disable the Firewall on both client and service side.

    Could you share us your demo project? I would suggest you download below project, and make a test with the project "WF_WCF_Samples\WCF\Basic\Discovery\Configuration\CS", will it work in the same domain and different domains?

    #Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4

    https://www.microsoft.com/en-sg/download/details.aspx?id=21459


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 1, 2017 6:26 AM
  • Hi,

    Firewall on both the client and server side are disabled. Not sure If I can share demo project. I will need to check on this. I will try downloading the project suggested by you and let you know the outcome.

    Regards,

    Kushal.

    Monday, May 8, 2017 3:57 PM
  • If you have any update about your issue, please feel free to let us know.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 10, 2017 1:46 AM