Reputation: 132
I have a simple soap client developed in .Net core 2.0 to consume calculator methods from the following web service: http://www.dneonline.com/calculator.asmx?WSDL The service is imported into Visual Studio 2017 as a connected service and the code that calls the service methods looks as below:
var binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
var ep = new EndpointAddress("http://www.dneonline.com/calculator.asmx?WSDL");
Calculator.CalculatorSoapClient client =
new Calculator.CalculatorSoapClient(binding, ep);
client.AddAsync(1, 3).Wait();
Console.WriteLine("Finished successfully");
Console.ReadLine();
Now the thing is that this code fails after 20 seconds when calling the AddAsync methodwith an exception of "WinHttpException: The operation timed out". Other relevant observations:
Has anyone faced any similar issue or knows why .NET core behaves differently?
Update 1 We tested the solution on a cloud based computer and it worked fine. So, it looks to be the company firewall blocking the outgoing communication. On the other hand on the same local computer, we tested a simple .Net Core application that downloads an image from a website and that worked well too. This is all while VS 2015 with .NET Framework has no problem running the same code, calling a web service and fetching the results. So, the new question can be why .NET Core behaves differently on the network communication? Is there any new rule, policy, permission, restriction, capability, etc that needs to be turned on/off to enable coomunication with the internet?
Upvotes: 2
Views: 1339
Reputation: 1611
There was a bug in .net Core 2.0 with proxy configuration, as you could see here: https://github.com/dotnet/wcf/issues/1592.
The solution for my project (VS 2017/.net Core 2.0) was to upgrade it to .net Core 2.1, and update System.ServiceModel.Http and other dependencies to latest stable (4.5.3 in my case). Then the IE/Edge proxy settings are used.
This question is possibly a duplicate of: Connecting to a SOAP service with .Net Core 2.0 behind a proxy
Upvotes: 2