Consuming webservice with WSDL and XSD files

We asked the company to write a web service that we can use to get some information. They sent us the WSDL and XSD files. Could you tell me how can I use these files to request data? I can do this easily if I have a link to a web service. I just provide a link, and Visual Studio creates a web link for me. After that, I can use this link as a regular class. In this case, I have no link. Only the above files. Thanks.

+6
source share
2 answers

You can create a proxy (add a service link in visual studio) from a wsdl file. You can read about svcutil at http://msdn.microsoft.com/en-us/library/aa347733.aspx , but VS2010 allows you to put the wsdl file in the address when adding a link to the service.

+5
source

VS2010 cannot create a web service link from some WSDLs. Have to write a special shell for them . Or edit your WSDL so that VS can use it. For example, it may be convenient for you to remove web pages of method method links for methods that you do not plan to use if these links create problems for you.

If you are not stuck with .NET 2.0, you should not use ASMX web services technology.

You must use the "Add Service Link" and point it to the WSDL on disk. It will create a set of proxy classes with methods that you can call as if it were a "normal" class.

See "How to Use a Web Service" for a walkthrough with an example.

Use the WSDL.EXE utility to create a web service proxy from WSDL.

eg.

wsdl /language:CS /n:"Microsoft.SqlServer.ReportingServices2010" http://<Server Name>/reportserver/reportservice2010.asmx?wsdl 

check this out for Creating and Using .NET Web Services in 5 Simple Steps in an Article , and then Creating a Web Service Proxy

Ref:
WSDL and use the web service
consumes non .NET webservice via WSDL file
How to use WSDL

+2
source

Source: https://habr.com/ru/post/916659/


All Articles