首页 > 解决方案 > svcutil.exe 无法生成代理“错误:缺少命名空间 http://xml.avaya.com/ws/VPAppIntf/VoicePortal 中名为 null 的元素消息”

问题描述

虽然我可以在启用身份验证的 https 服务上输入用户名和密码后下载 WSDL,但当通过 svcutil 生成代理时,会出现以下异常

错误:无法导入 wsdl:portType 详细信息:运行 WSDL 导入扩展时引发异常:System.ServiceModel.Description.DataContractSerializerMessageContractImporter 错误:来自命名空间http://xml.avaya.com/ws/VPAppIntf/VoicePortal的元素消息命名为 null不见了。错误源的 XPath://wsdl:definitions[@targetNamespace='http://xml.avaya.com/ws/VPAppIntf/VoicePortal']/wsdl:portType[@name='VPAppIntfServicePortType']

错误:无法导入 wsdl:binding 详细信息:导入 wsdl:binding 所依赖的 wsdl:portType 时出错。wsdl:portType 的 XPath://wsdl:definitions[@targetNamespace='http://xml.avaya.com/ws/VPAppIntf/VoicePortal']/wsdl:portType[@name='VPAppIntfServicePortType'] 错误源的 XPath: //wsdl:definitions[@targetNamespace='http://xml.avaya.com/ws/VPAppIntf/VoicePortal']/wsdl:binding[@name='VPAppIntfServiceSoap11Binding']。. . . 正在生成文件... 警告:未生成任何代码。如果您尝试生成客户端,这可能是因为元数据文档不包含任何有效的合同或服务,或者因为发现所有合同/服务都存在于 /reference 程序集中。验证您是否将所有元数据文档传递给该工具。

警告:如果您想从模式生成数据协定,请确保使用 /dataContractOnly 选项。

标签: svcutil.exe

解决方案


推荐阅读