C# Windows Forms Web Services

Asked

Viewed 277 times

3

I wonder if it is possible to work with web services using the application made in windows Forms. Is it possible ? If so, would you have any reference that might help me solve this ?

  • Do you want to consume a webservice using Windows Forms? If so, of course it is possible! What kind of webservice do you intend to consume?

  • 1

    In the project, select "Add Web Reference" and put your url. Visual Studio creates the structures for you to consume the service.

1 answer

2

Consuming Webservices in Applications WindowsForms

To consume a webservices (considering that they are provided by the .net framework) you must follow the following steps:

  • Right click on Referências(References) and then on Adicionar Referência de Serviço(Add Service Reference or Web Reference).
  • Enter the website address (.asmx or .svc) and click Discover.
  • In this step the window below will already be updated with the allowed methods.
  • Select the desired methods and enter the desired namespace for the ex service calls: MeuProjeto.Integracoes.Parcerias.
  • Considering that you have succeeded in the above steps you can use the webservices as internal classes of your system through the namespace you assigned in the previous step.

If there are any questions please do not hesitate to point out that I will update the question with the information.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.