问题
I have created a service called GetReportService. My endpoint is http://xxx1/usa/report.asmx. I am using POST passing a parameter id123.
How do I invoke this web service using a web api in .NET Core 2.0?
回答1:
I figured out that the connected service option is a WCF service so I am able to consume the service as I normally would in previous versions of .NET.
However, in .NET Core if I want to inject that service, I do have to go to the Startup.cs file and add my service in the ConfigureServices method and then inject the service into my controller.
This is a more detailed explanation of what I did: How to inject WCF service client in ASP.Net core?
来源:https://stackoverflow.com/questions/48996467/how-to-consume-a-web-service-using-net-core-2-0-connected-services