Search code examples
c#asp.net-web-apiasmx

Calling an asmx service from Web API


Need to call asmx service from one of my get methods in web api .How can we do that ? Can we add a config entry in appsettings to the asmx service url and call it from the web api get mehod?

web config app settings entry:

key="myOldWebservice" value = "http://testAPI/webservice/client.asmx"/>

Solution

  • Add the asmx service as a Service Reference to your project in VS and call asmx methods from that reference. Just like invoking methods in dlls.