How to consume a web service using .NET Core 2.0 Connected Services

依然范特西╮ 提交于 2021-02-08 07:24:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!