title: Wcf client call delay more 10 sec... in .NET CORE
body: <p>i want with WCF Connected service in .Net core 3, currently  i've a  wcf method for create a pdf document... </p>
  
  <p>the method works well locally, delay between 1500 - 2500 ms... but when i publish the app in IIS this method delay more 15000ms, that's too much and the user is scared, can this be optimized at the code level? or is it an IIS configuration?</p>
  
  <pre><code>private async Task&lt;DocumentsService.invokeResponse&gt; _createDoc(string strXml)
  {
      System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
      timer.Start();
  
      var endpoint = new DocumentsService.wsDocumentsClient.EndpointConfiguration();
      var service = new DocumentsService.wsDocumentsClient(endpoint);
      var response = new DocumentsService.invokeResponse();
  
      var parameter = new DocumentsService.XML();
      parameter.document = strXml;
  
      service.ClientCredentials.UserName.UserName = "user"
      service.ClientCredentials.UserName.Password = "password";
  
      var scope = new OperationContextScope(service.InnerChannel);
      var httpRequestProperty = new HttpRequestMessageProperty();
      httpRequestProperty.Headers[HttpRequestHeader.Authorization] = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(service.ClientCredentials.UserName.UserName + ":" + service.ClientCredentials.UserName.Password));
  
      OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;
  
      response = await service.invokeAsync(parameter); //this delay
  
      timer.Stop();
      var time = timer.ElapsedMilliseconds; //local host 1500 - 2500 ms... in IIS more 10.000 ms
      return response;
   }
  </code></pre>
  
  <p>Update: the method delay is response = await service.invokeAsync(parameter); </p>