C # WSDL proxy methods

I need to use a SOAP web service from a C # .Net 4.0 client. I added WSDL as a service reference in VS 2008 and now I can see the XML types as classes so that I can create a SOAP message.

The WSDL port is defined as an interface, and the two operations defined in the WSDL (UploadMessage and ValidateMessage) are visible methods.

How do you actually use these methods? I thought that Port would be accessible as a class so that you could directly call methods and that VS would create the appropriate code to send the SOAP message, but it looks like you need to write code to go with these methods. It's right?

I have googled but can't find a simple example using .Net 4.0; - (

+3
source share
2

Add Service Reference, ( Add Service Reference - ).

alt text

, (yourservicename)Client.

, Service References node Visual Studio Show All Files Solution Explorer - , .

alt text

Reference, , Reference.cs, , WSDL.

alt text

Reference.cs . , . - , .

+2

Service Reference [ServiceName]Client, .

, .

, , , . .

+1

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


All Articles