tags:

views:

42

answers:

2

hi, I wanted to make an application that will take either the path of the dll or Webservice and list me all the functions present in that dll. I accomplished the listing of the function using this but I am not able to list the functions of the Webservices. Using Assembly.GetMembers() it's listing the Function Name with the Parameters Type and I am not able to get the Parameters Name. How shall i get that? While debugging I found that m_parameters is a nonpublic member and i'm not able to get the Parameter name. Is that possible??? And one more question is how shall i list the functions available in the web service without including the web reference or service reference in the windows application using C#.

+1  A: 

To get the parameter name, use MethodInfo.GetParameters followed by ParamterInfo.Name property.

logicnp
Hey thanks thats working!!! Any idea about the Web service functions listing???
Jankhana
Do you have at least the dll implementing the webservice? If yes, then aren't you already doing the functions listing using MethodInfo, etc. If not, then its not possible to list the functions. How can you list functions from something which you dont even have hold of in ANY form whatsoever?
logicnp
I have the path where the web service is located using that path i want to get the list of functions available there. as we go to browser and see the functions listed there in the similar way I need in my windows appliaction.
Jankhana
+3  A: 

What webservices are you talking about?? ASP.NET ASMX webservices? Webservices based on WCF??

In any case, most of those web services will expose a WSDL document which basically contains the methods on the web service, plus the parameters expected for a call.

Mind you: web services don't have to publish a WSDL - it's optional. But if there is one, it's typically accessed by adding ?wsdl to the URL where the service lives, so if you want to find out what methods and parameter the prime number generator web service at:

http://www50.brinkster.com/vbfacileinpt/np.asmx

has, you do go

http://www50.brinkster.com/vbfacileinpt/np.asmx?wsdl

and grab the WSDL and start analyzing it.

marc_s
Thanks a lot. So ?wsdl will get me the webservice in the format of Xml schema associated and i'll surely try to use this schema and get the list of functions and parameters. Thanks again!!!
Jankhana
@Jankhana: yes, as long as the WSDL is publicly accessible, that's the way to go!
marc_s
Ya. So first I need to see if WSDL is accessible or not. If so than I can use HTTPBrowser and try out something.
Jankhana