0

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:

enter image description here

leppie
  • 115,091
  • 17
  • 196
  • 297
user3386436
  • 39
  • 1
  • 6

1 Answers1

1

Click References->Add Service Reference Then a dialog will appear as follows,

enter image description here

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