【问题标题】:How to consume a web service using .NET Core 2.0 Connected Services如何使用 .NET Core 2.0 Connected Services 使用 Web 服务
【发布时间】:2018-03-01 03:12:23
【问题描述】:

我创建了一个名为 GetReportService 的服务。我的终点是http://xxx1/usa/report.asmx。我正在使用 POST 传递参数 id123。

如何在 .NET Core 2.0 中使用 Web api 调用此 Web 服务?

【问题讨论】:

    标签: web-services asp.net-core-2.0 asp.net-core-webapi


    【解决方案1】:

    我发现已连接服务选项是 WCF 服务,因此我可以像在以前的 .NET 版本中一样使用该服务。

    但是,在 .NET Core 中,如果我想注入该服务,我必须转到 Startup.cs 文件并在 ConfigureServices 方法中添加我的服务,然后将服务注入我的控制器。

    这是对我所做的更详细的解释: How to inject WCF service client in ASP.Net core?

    【讨论】:

      猜你喜欢
      • 2018-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-11
      • 1970-01-01
      • 2018-03-15
      • 1970-01-01
      相关资源
      最近更新 更多