Failed to create proxy from WSDL to VS2017

I have a WSDL that I am trying to create a client proxy from Visual Studio 2017.

  • Right-click project name (WinForm)
  • Add> Service Link
  • Insert WSDL adr
  • Click OK

Now I have 1 error and 20 warnings

Error

Severity Code Description Project File Line Suppression State Error Error Custom tool error: Could not generate code for service link "ServiceReference1". Check for other errors and warnings. Messages for Details. WindowsFormsApp1 c: \ users \ Me \ source \ repos \ WindowsFormsApp1 \ WindowsFormsApp1 \ Connected Services \ ServiceReference1 \ Reference.svcmap 1

Warnings (some of them)

Severity Code Description Project File Line Suppression State Warning Custom Tool Warning: Cannot import wsdl: port Detail: There was an import error wsdl: binding that wsdl: port depends on. XPath to wsdl: binding: //wsdl:definitions[@targetNamespace='MyTest.GetInformation:v2'-03/wsdl:binding[@name='GetInformationBinding '] XPath to Error Source: // wsdl: definitions [@ targetNamespace =' MyTest.GetInformation: v2 '] / wsdl: service [@ name =' GetInformationService '] / wsdl: port [@ name =' GetInformationPort '] WindowsFormsApp1 c: \ users \ Me \ Source \ Repos \ WindowsFormsApp1 \ WindowsFormsApp1 \ Connected Services \ ServiceReference1 \ Reference.svcmap 1

Severity Code Description Project File Line Suppression State Warning Warning about user tool: cannot import wsdl: binding Details: there was an import error wsdl: portType that wsdl: binding is dependent on. XPath to wsdl: portType: //wsdl:definitions[@targetNamespace='MyTest.GetInformation:v2'†/wsdl:portType[@name='GetInformationInterface '] XPath to Error Source: // wsdl: definitions [@ targetNamespace =' MyTest.GetInformation: v2 '] / wsdl: binding [@ name =' GetInformationBinding '] WindowsFormsApp1 c: \ users \ Me \ source \ repos \ WindowsFormsApp1 \ WindowsFormsApp1 \ Connected Services \ ServiceReference1 \ Reference.svcmap 1

Severity Code Description Project File Line Suppression State Warning Custom Tool Warning: Cannot import wsdl: portType Detail: An exception was thrown while starting the import extension WSDL: System.ServiceModel.Description.XmlSerializerMessageContractImporter Error: data type "MyTest.attentionSignal: v1: II" - is absent. XPath to Error Source: //wsdl:definitions[@targetNamespace='MyTest.GetInformation:v2'†/wsdl:portType[@name='GetInformationInterface '] WindowsFormsApp1 c: \ users \ Me \ source \ repos \ WindowsFormsApp1 \ WindowsFormsApp1 Connected Services \ ServiceReference1 \ Reference.svcmap 1

SoapUI 5.3.0 can generate proxies from the same WSDL, and I can also generate it using the Web Reference (compatibility mode 2.0) in VS2017. A later solution, however, does not work for me, because I have code from v1 of this WSDL that I want to reuse.

Edit:

Here is the WSDL, add it as a service referee in VS 2017, and you should see the problem: https://1drv.ms/u/s!AskujIssKpne6170QEQdCLrkG8-u

+5
source share
1 answer
  • you must download wsdl locally using a browser and then follow your rest steps
  • Right-click project name (WinForm)
  • Add> Service Link
  • Paste the local WSDL path and click OK

Update: If the above path does not work. You can try another way - Create an XSD.exe web proxy using the following command

wsdl.exe [path To Your WSDL File] //in visual studio command line 
  • This will create proxy classes that you can copy / move into your project and use.
0
source

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