web service look up  
Author Message
C#Student





PostPosted: .NET Framework Networking and Communication, web service look up Top

Hi,

How do I access a web service method in C# to retrieve a paremeter value

Thanks,




.NET Development35  
 
 
SvenC





PostPosted: .NET Framework Networking and Communication, web service look up Top

Can you be a bit more specific Do you want to call a method of a web service Have you got a WSDL definition of the webservice E.g. ASP.Net WebServices can expose their WSDL by adding wsdl after their URL.

Add that WSDL as a web reference to your project - see the context menu of your References folder in the solution view.

That will create a proxy class. The class has one method for each WebService method. Just create an object of that class and call the methods to invoke the WebService.

Does that answer your question

--
SvenC


 
 
Nikunj R Thakkar





PostPosted: .NET Framework Networking and Communication, web service look up Top

Hi,

As said above, u'll have to add first reference of WS in ur project by right clicking on WebReferences. You will mostly required to click on "Web Services on local machine" and select webservices which you require and click on add reference. Make sure that you have namespace included.

Then simply you will have to create an instance of that webservice and using that instance you can have list of available public methods. Use method which you need and pass parameter if required and webservice should return you expected result.

Hope this helps

Thanks