【发布时间】:2018-11-19 10:54:18
【问题描述】:
我之前使用过 WCF 应用程序并且没有问题,但现在使用此服务时我遇到了一些问题。我不确定背后的原因是什么,但我无法在我的项目中添加https://smp.difi.no/ws/2.0?wsdl。
我也得到的错误如下:
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://service.elma.difi.no/']/wsdl:binding[@name='ElmaServiceImplServiceSoapBinding']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://service.elma.difi.no/']/wsdl:service[@name='ElmaServiceImplService']/wsdl:port[@name='ElmaServiceImplPort']
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='no:difi:elma:smp:webservice']/wsdl:portType[@name='difi']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://service.elma.difi.no/']/wsdl:binding[@name='ElmaServiceImplServiceSoapBinding']
Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: These members may not be derived.
XPath to Error Source: //wsdl:definitions[@targetNamespace='no:difi:elma:smp:webservice']/wsdl:portType[@name='difi']
知道这里出了什么问题吗?从 SoapUI 尝试过并且工作正常,但不是从 VS。
【问题讨论】:
-
Google
Error: These members may not be derived.获取一些建议。 -
使用非核心框架,您可以在命令行上使用 /wrapped 来解决这个问题,VS 似乎会自动执行此操作。
-
有 dotnet core 命令行工具,但我没有使用它们的经验。
标签: c# visual-studio soap .net-core