title: Hosting WCF service in Azure Service Fabric
body: <p>I have a set of WCF services that I would like to migrate to Azure Service Fabric. I am creating a service fabric stateless service for each WCF service, and reference the WCF service library and contracts from my fabric service. My aim is zero code change to existing WCF service libraries and contracts. The fabric service acts like wrappers. </p>
  
  <p>I am successful for simple services, I put the WCF service configurations into the app.config file of fabric service (.NET framework), the <code>system.configuration.configurationmanager</code> calls in existing wcf code seems to work fine.</p>
  
  <p>However, many of the more complicated services that I am trying to migrate contains code that calls other WCF service using <code>ChannelFactory</code>. I wonder will this work? Does Azure Service Fabric allow its service to make external communication calls through <code>ChannelFactory</code>?</p>
  
  <p>How can I read the WCF tracing logs in service fabric? There is no local drive to store the log files?</p>
  
  <p>I am also getting generic connection closed error when a client calls wcf service in the fabric.</p>
  
  <p>[EDIT]
  The load balancer was configured but the client still can't get through:</p>
  
  <pre><code>
  Could not connect to net.tcp://10.0.0.6:9012/. The connection attempt lasted for a time span of 00:00:21.0433425. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.0.6:9012. 
  Server stack trace: 
     at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
     at System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
     at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
     at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
     at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
     at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
      Inner Exception:
  A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.0.6:9012
     at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
     at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
     at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)
  </code></pre>