从Web API调用asmx服务

问题描述 投票:0回答:1

需要从web api中的一个get方法调用asmx服务。我们可以这样做吗?我们可以在appsettings中将配置条目添加到asmx服务URL并从web api get mehod调用它吗?

web配置应用设置条目:

key="myOldWebservice" value = "http://testAPI/webservice/client.asmx"/>
c# asp.net-web-api asmx
1个回答
0
投票

将asmx服务作为Service Reference添加到VS中的项目中,并从该引用调用asmx方法。就像在dll中调用方法一样。

© www.soinside.com 2019 - 2024. All rights reserved.