I am trying to learn how to use methods from a web service into a C# form. I am following some examples, but i am confused on how exactly you add the reference from the form onto the web service and how can you use the methods from the Service.cs into the form's source code. I have left a picture to clarify what I need help understanding when it comes to how to properly link it:
Asked
Active
Viewed 43 times
0
-
possible duplicate http://stackoverflow.com/questions/5200024/soap-web-service-vs2010-add-service-reference – Piyush Parashar Dec 03 '14 at 05:14
1 Answers
1
Click References->Add Service Reference Then a dialog will appear as follows,
Then create the client as follows,
sampleSvc.CommonDataClient _client = new sampleSvc.CommonDataClient();
You can access the method like this,
_client.CreateTable();

Sajeetharan
- 216,225
- 63
- 350
- 396
-
Very interesting, this works and now I am able to use those methods. But I still I am a little unsure about the "DesktopConsumer" form being repeated in the web service and on its own project. Any reason/benefit for this? – user3386436 Dec 03 '14 at 05:25
-
@user3386436 You must have been using the reference of it somewhere – Sajeetharan Dec 03 '14 at 05:26