Is there a way to call a web method in WCF without ever writing an application or using cURL as suggested in WCF – possible to call a wcf service from the command line with parameters? ?
I was able to do this with asmx. For example, i was able to just launch in cmd:
> start http://myservice/abc.asmx/?op=DoSomething
but it doesn’t seem to be possible on WCF web service.
Thanks
It depends on which binding you are using in WCF. The majority of the WCF bindings are SOAP-based services, which would require complex payloads to be produced and this wouldn’t be feasible using CURL or the browser.
If however you used the WCF REST bindings (webHttpBinding) and had no requirements around HTTP header data you could call such as a service from the command line.
I would like to call out however WCF REST has since been superseded by ASP.NET WEB API as the preferred approach to creating REST-based services. If you have no other business usage for WCF then I would consider Web API as an alternative.