If the web service is a SOAP service then you can get the wsdl into a XDocument object or XmlDocument and then read the wsdl:operation elements within wsdl:portType element to get all the operations available.
NOTE: This is possible only if the wsdl is exposed by the service provider.
Sample wsdl with few operations as shown:
<wsdl:portType name="ISampleService">
<wsdl:operation name="GetData">
<wsdl:input wsaw:Action="http://tempuri.org/ISampleService/GetData" message="tns:ISampleService_GetData_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/ISampleService/GetDataResponse" message="tns:ISampleService_GetData_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="GetEmail">
<wsdl:input wsaw:Action="http://tempuri.org/ISampleService/GetEmail" message="tns:ISampleService_GetEmail_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/ISampleService/GetEmailResponse" message="tns:ISampleService_GetEmail_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="GetPersonCount">
<wsdl:input wsaw:Action="http://tempuri.org/ISampleService/GetPersonCount" message="tns:ISampleService_GetPersonCount_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/ISampleService/GetPersonCountResponse" message="tns:ISampleService_GetPersonCount_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
The above section from a service exposes 3 methods:
- GetData
- GetEmail
- GetPersonCount