title: Failed to invoke the service. Possible causes: The service is offline or inaccessible while Invoking
body: <p>I have my service configured as below:</p>
  <pre><code>&lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service name=&quot;WcfService1.Service1&quot; behaviorConfiguration=&quot;MyServiceTypeBehaviors&quot;&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress=&quot;net.tcp://127.0.0.1:808/service&quot; /&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
          &lt;endpoint address=&quot;net.tcp://127.0.0.1:808/service/&quot;
                    binding=&quot;netTcpBinding&quot;
                    contract=&quot;WcfService1.IService1&quot;/&gt;
          &lt;endpoint address=&quot;mex&quot; binding=&quot;mexTcpBinding&quot; contract=&quot;IMetadataExchange&quot;   /&gt;
  
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;protocolMapping&gt;
        &lt;add scheme=&quot;net.tcp&quot; binding=&quot;netTcpBinding&quot;/&gt;
      &lt;/protocolMapping&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name=&quot;MyServiceTypeBehaviors&quot;&gt;
            &lt;serviceMetadata httpGetEnabled=&quot;true&quot;/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;endpointBehaviors&gt;
        &lt;behavior name=&quot;MyEndpointBehaviour&quot;&gt;
          &lt;webHttp/&gt;
        &lt;/behavior&gt;
      &lt;/endpointBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled=&quot;true&quot; multipleSiteBindingsEnabled=&quot;true&quot; /&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  <p>and the client as:</p>
  <pre><code> &lt;system.serviceModel&gt;
          &lt;bindings&gt;
              &lt;netTcpBinding&gt;
                  &lt;binding name=&quot;NetTcpBinding_IService1&quot; sendTimeout=&quot;00:05:00&quot; /&gt;
              &lt;/netTcpBinding&gt;
          &lt;/bindings&gt;
          &lt;client&gt;
              &lt;endpoint address=&quot;net.tcp://127.0.0.1/service/&quot; binding=&quot;netTcpBinding&quot;
                  bindingConfiguration=&quot;NetTcpBinding_IService1&quot; contract=&quot;IService1&quot;
                  name=&quot;NetTcpBinding_IService1&quot;&gt;
                  &lt;identity&gt;
                      &lt;servicePrincipalName value=&quot;host/MachineName&quot; /&gt;
                  &lt;/identity&gt;
              &lt;/endpoint&gt;
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  </code></pre>
  <p>When using WCFTestClient or SVCutil, I am able to discover and access the servie and generate proxy or stubs.</p>
  <p>But when I want to invoke any of the methods getting following error:</p>
  <blockquote>
  <p>Failed to invoke the service. Possible causes: The <strong>service is offline</strong> or <strong>inaccessible</strong>; the <strong>client-side configuration does not match the proxy</strong>; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service.</p>
  <p><strong>The socket connection was aborted.</strong> This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:04:59.9980468'.</p>
  </blockquote>