Click here to Skip to main content
15,309,563 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I am getting below error when I am trying to call WCF service from ASP.Net Core, this is happening only when both wcf service and API deployed on IIS 10.

Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<invokenextactionfilterasync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) System.ServiceModel.CommunicationException: No connection could be made because the target machine actively refused it.
---> System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it.
---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)

I am able to connect same WCF service from ASP.NET MVC controller. It fails only when we access from .net core.

Any thoughts here, will be greatly apricated.


Thanks,
Pani

What I have tried:

I have tried to make checking ports are open from wcf service server to API server both port 80 and 443 are open
Posted
Updated 3-Jul-20 0:41am

1 solution

Either you're trying to connect on the wrong port, or there is a firewall blocking the connection.

If you're trying to call the service using the public domain name, then the traffic is probably being sent via your router. Try using the internal IP address to connect instead, or add an entry to the hosts file on the server to locally override the IP address for your domain.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900