title: Windows Service could not connect to WCF Service when installed on the same web server
body: <p>I have to provide the userPrincipalName if the windows service is installed on the same web server but I can remove the identity tag if the windows service is installed on any other machine. what could be the reason of such behaviour? 
  NOTE: Application pool is running under custom domain account
  Here is my Windows Service app.config settings:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;wsHttpBinding&gt;
          &lt;binding name="WSHttpBinding_ITimerJobService"&gt;
            &lt;security mode="TransportWithMessageCredential"&gt;
              &lt;transport clientCredentialType="Windows" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="https://domain/TimerJobService.svc"
          binding = "wsHttpBinding" bindingConfiguration = "WSHttpBinding_ITimerJobService" contract="TimerJob.ITimerJobService" name= "WSHttpBinding_ITimerJobService"&gt;
          &lt;identity&gt;
              &lt;userPrincipalName value="ApplicationPoolIdentity"/&gt;
            &lt;/identity&gt;
        &lt;/endpoint&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Thank you very much.</p>