How to programmatically retrieve all of a web serv

2019-08-08 09:34发布

问题:

I'm trying to build a c# application that displays and invokes all of a specific web service's methods (the web service is written as a .asmx file).
I can go directly to the asmx file and get the methods names from the returned html, but I'm sure there is more elegant way to do it (this way doesn't reveals the web methods' signatures as well, only their names..).

So how can I programmatically ask the service what are it's methods?

Thanks.

回答1:

Get the WSDL of your web-service to discover all available methods on the web-service.

http://server/your-webservice.asmx?wsdl