将WSDL文件添加为服务引用Visual Studio 2010时出错

时间:2017-04-27 10:52:46

标签: c# visual-studio-2010 wsdl

我将继续How to use a WSDL。我从供应商处获得了一个WSDL文件。我在Visual Studio 2010中添加了“服务引用”。获取以下2个错误。

    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: Choice is not supported with encoded SOAP. Please change definition of schema type 'MessageData' from namespace 'http://somethinghere': use all or sequence (not choice) for fields/parameters.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://somethinghere']/wsdl:portType[@name='SoSPortType']     C:\ \Reference.svcmap 1    1    Decoder_CLI

    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://somethinghere']/wsdl:portType[@name='SoSPortType']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://somethinghere']/wsdl:binding[@name='SoSSoapBinding']     C:\\Reference.svcmap 1    1    Decoder_CLI

有很多此类帖子可用于此类警告,但针对我的特定错误

Error: Choice is not supported with encoded SOAP

我找不到任何解决方案。欢迎任何帮助。顺便说一下,我已经尝试过作为Web引用,取消检查引用程序集中的"重用类型"等等,以及互联网上已有的所有其他解决方案。

更新

忘了提。我还试图将这个WSDL作为SOAP项目添加到SoapUI客户端上,没有任何错误就可以使用它。

0 个答案:

没有答案