Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use a Web Service in C# Windows App

I am new to using web services. I am assigned a task in which I need to use a web service in my Windows app. This is the web service I would be using: https://api.betfair.com/global/v3/BFGlobalService.wsdl

Now, I've learned how to add a web reference to this service, but I could not find a basic tutorial that could help me learn how to make an object of this web service and use the service as I want to.

Basicaly, what I need is to create an object from the above web service in my form, and to call it's methods. A C# code snippet would be great.

Can anyone give me some directions? I am working in Visual Studio 2008 and a C# Windows App.

like image 924
Samy S.Rathore Avatar asked Jun 25 '12 06:06

Samy S.Rathore


People also ask

What is a web service in C#?

Introduction. Web Service is known as the software program. These services use the XML to exchange the information with the other software with the help of the common internet Protocols. In the simple term, we use the Web Service to interact with the objects over the internet.

Which is better Web API or web service?

Difference between Web Services and APIs: APIs are application interfaces, implying that one application can communicate with another application in a standardized manner. Web service is used for REST, SOAP and XML-RPC for communication. API is used for any style of communication.

When should we use Web services?

Web services are used for a variety of applications, but the most common is for reusing code and connecting existing programs. The web service method can help developers segment applications into components that can be used and reused for various needs.


2 Answers

  1. Right click on References
  2. select Add Service Reference
  3. give the wsdl address in the address textbox
  4. click Discover
  5. Give a name for the namespace eg;- BFG
  6. You can access the resources like BFG.MethodName() from you code
like image 147
shajivk Avatar answered Oct 05 '22 19:10

shajivk


for consuming a web service here is the steps for that.see it.,from there you will get your solution.

click here

like image 39
ketan italiya Avatar answered Oct 05 '22 17:10

ketan italiya