将ideone服务添加到asp .net网站时出错

时间:2015-03-09 09:07:45

标签: web-services soap wsdl

我正在尝试在asp .net网站上添加服务引用,但出现错误

Error   1   
Reference.svcmap: Failed to generate code for the service reference 'ServiceReference1'.  Cannot import wsdl:portType  
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter  
Error: The datatype 'http://schemas.xmlsoap.org/soap/encoding/:Array' is missing.  XPath to 
Error Source: //wsdl:definitions[@targetNamespace='http://ideone.com/api/1/service']/wsdl:portType[@name='Ideone_Service_v1Port']  Cannot import wsdl:binding  
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on 

我尝试配置服务引用并取消选中Reuse types in reference assemblies,但没有任何变化。

2 个答案:

答案 0 :(得分:1)

似乎代码生成工具找不到http://schemas.xmlsoap.org/soap/encoding/的xsd。尝试将wsdl文件(http://ideone.com/api/1/service.wsdl)下载到本地磁盘。然后像这样更改wsdl中的types部分:

<types>
  <xsd:schema>
    <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>
  </xsd:schema>
</types>

然后从本地wsdl重新生成服务引用。使用本地路径(例如C:\ service.wsdl)作为wsdl url。

答案 1 :(得分:0)

非常感谢该解决方案真的帮助我成功添加服务引用但我不知道在运行服务时我得到了错误#34; Microsoft Visual Studio远程调试监视器(MSVSMON.EXE)似乎没有运行远程计算机!!!