title: WCF Service unable to call from .NET Core
body: <p>I am doing something wrong and I can't figure it out ... I made .NET Framework 4 console application to communicate with SOAP Service, with use of Topshelf I deployed service on a server and with simple URL access to a method or use of Boomerang tool, I can see service is returning value </p>
  
  <p>URL: <a href="http://35.231.17.237:8066/ERPCommunicationService/OriginalService/IsServiceHealthy" rel="nofollow noreferrer">http://35.231.17.237:8066/ERPCommunicationService/OriginalService/IsServiceHealthy</a></p>
  
  <p>But now, when I try to access same service, from .NET Core project, I keep getting error: </p>
  
  <pre><code>System.ServiceModel.ProtocolException: 
       The remote server returned an unexpected response: (405) Method Not Allowed.
     at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
     at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(
        SendAsyncResult result)
     at System.ServiceModel.Channels.ServiceChannel.EndCall(
        String action, Object[] outs, IAsyncResult result)
     at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.&lt;&gt;c__DisplayClass1_0.
        &lt;CreateGenericTask&gt;b__0(IAsyncResult asyncResult)
  --- End of stack trace from previous location where exception was thrown ---
  </code></pre>
  
  <p>Code is simple, I successfully used service endpoint to connect it to .NET Core project, where I can see <code>Reference.cs</code> autogenerated file and all methods from service are there ... </p>
  
  <p>Here is service call from client side (.net core):</p>
  
  <pre><code>public async Task&lt;bool&gt; IsServiceHealthy()
  {
     try
     {
  
        string servicesUrl = $"{_iConfiguration["servicesUrl"]}/IsServiceHealthy";
  
  
        //My binding setup, since ASP.NET Core apps don't use a web.config file
        var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
        binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
        binding.MaxReceivedMessageSize = 10485760;
        binding.SendTimeout = new TimeSpan(0, 0, 0, 180);
        binding.ReceiveTimeout = new TimeSpan(0, 0, 0, 180);
  
  
        var rsExec = new OriginalService.OriginalServiceClient(binding, 
                                          new EndpointAddress(servicesUrl));
  
        var clientFactory = rsExec.ChannelFactory.CreateChannel();
        var response = await clientFactory.IsServiceHealthyAsync();
  
        return response;
      }
      catch (Exception ex)
      {
          logging.LogError(ex.ToString());
          throw ex;
      }
  }
  </code></pre>
  
  <p>And code from server side (.NET Framework 4): </p>
  
  <p>Interface: </p>
  
  <pre><code>    [OperationContract]
      [WebInvoke(Method = "GET",
          RequestFormat = WebMessageFormat.Json,
          UriTemplate = "/IsServiceHealthy")]
      bool IsServiceHealthy();
  </code></pre>
  
  <p>Implementation:</p>
  
  <pre><code>public bool IsServiceHealthy()
  {
      bool serviceResult = false;
  
      byte[] test = new byte[200];
      var client = new ChannelFactory&lt;BisWebWS.BisWebWSSOAPPortType&gt;("BisWebWSSOAPPort")
      .CreateChannel();
  
      BisWebWS.tauthStrct auth = ServisBasic.GetAuth();
  
      try
      {
          var result = client.wsTest(new BisWebWS.wsTestRequest(test));
  
          serviceResult = result.wsTestResult;
      }
      catch (Exception ex)
      {
          logger.LogError(ex.InnerException.ToString());
      }
  
      return serviceResult;
  }
  </code></pre>
  
  <p>When ever I google shown error, everywhere it says its server side setup, but I am kinda stuck as I installed everything there is ... I am using MS Windows Server 2012 R2 Datacenter,</p>
  
  <p>Thank you for shared idea how to fix this problem</p>