I'm trying to add service reference to my (.NET 4.6) project.
When I choose Add Service Reference
and add URL of WSDL I can see it is correctly discovered:
I've unchecked Reuse types in all referenced assemblies
as shown below:
But when I click OK
I get three warnings in Error List window:
Warning 1 Custom tool warning: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter Error: Unable to cast object of type 'System.Xml.Serialization.StructMapping' to type 'System.Xml.Serialization.MembersMapping'. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://bik.pl/cc/big']/wsdl:portType[@name='BIG']
Warning 3 Custom tool warning: Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://bik.pl/cc/big']/wsdl:binding[@name='BIGBinding'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://bik.pl/cc/big']/wsdl:service[@name='BIG']/wsdl:port[@name='BIG']
Warning 2 Custom tool warning: Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://bik.pl/cc/big']/wsdl:portType[@name='BIG'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://bik.pl/cc/big']/wsdl:binding[@name='BIGBinding']
I've tried different options while importing, but I get those errors all the time.
I've validated WSDL using www.wsdl-analyzer.com but it shows no error:
Here is quality report: https://www.wsdl-analyzer.com/qualityReport/show/1784995829?version=1
SoapUI correctly shows all operations and I'm able to do them from SoapUI, but I need to add reference to my project in Visual Studio.
Below are links to WSDL and XSD:
https://wasstt.infomonitor.pl/39D97477-0709-455f-A7C8-6498B600AC5A/ws/BIG/WEB-INF/wsdl/dluznik.wsdl
https://wasstt.infomonitor.pl/39D97477-0709-455f-A7C8-6498B600AC5A/ws/BIG/WEB-INF/wsdl/dluznik.xsd
How can I import this WSDL into my project? I'm unable to modify structure of that WSDL, so I must use it as it is.
EDIT: I've installed XMLSpy and opened that WSDL in it. After opening I got message saying that WSDL is valid.