简体   繁体   English

svcutil.exe - 错误:无法导入wsdl:portType

[英]svcutil.exe - Error: Cannot import wsdl:portType

I have to integrate several existing webservices in my .net application. 我必须在我的.net应用程序中集成几个现有的webservices。 But unfortunately, invoking the svcutil tool results in an error with the message: 但不幸的是,调用svcutil工具会导致消息出错:

Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152] Copyright (c) Microsoft Corporation. Microsoft(R)服务模型元数据工具[Microsoft(R)Windows(R)Communication Foundation,版本3.0.4506.2152]版权所有(c)Microsoft Corporation。 All rights reserved. 版权所有。

Error: Cannot import wsdl:binding Detail: Cannot find definition for http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/V1.0:EnviarRespuestaVerifi carIdentidadCliente. 错误:无法导入wsdl:binding详细信息:找不到http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/V1.0:EnviarRespuestaVerifi carIdentidadCliente的定义。 Service Description with namespace http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/V1.0 is missing. 名称空间为http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/V1.0的服务描述丢失。 Parameter name: name XPath to Error Source: //wsdl:definitions[@targetNamespace=' http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/E nlace/V1.0']/wsdl:binding[@name='EnviarRespuestaVerificarIdentidadCliente_HttpBinding'] 参数名称:名称XPath到错误源:// wsdl:definitions [@ targetNamespace =' http: //grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/E nlace / V1.0'] / wsdl:binding [@name = 'EnviarRespuestaVerificarIdentidadCliente_HttpBinding']

Error: Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. 错误:无法导入wsdl:port详细信息:导入wsdl:port依赖的wsdl:binding时出错。 XPath to wsdl:binding: //wsdl:definitions[@targetNamespace=' http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/E nlace/V1.0']/wsdl:binding[@name='EnviarRespuestaVerificarIdentidadCliente_HttpBinding'] XPath to Error Source: //wsdl:definitions[@targetNamespace=' http://grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/E nlace/V1.0']/wsdl:service[@name='EnviarRespuestaVerificarIdentidadCliente']/wsdl:port[@name='EnviarRespuestaVerificarIdentidadCliente_HttpPort'] XPath to wsdl:binding:// wsdl:definitions [@ targetNamespace =' http: //grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/E nlace / V1.0'] / wsdl:binding [@ name ='EnviarRespuestaVerificarIdentidadCliente_HttpBinding '] XPath to Error Source:// wsdl:definitions [@ targetNamespace =' http: //grupobancolombia.com/intf/Clientes/GestionClientes/EnviarRespuestaVerificarIdentidadCliente/E nlace / V1.0'] / wsdl:service [@ name =' EnviarRespuestaVerificarIdentidadCliente '] / WSDL:端口[@名称=' EnviarRespuestaVerificarIdentidadCliente_HttpPort']

Generating files... Warning: No code was generated. 生成文件...警告:未生成任何代码。 If you were trying to generate a client, this could be because the metadata documents did not contain any valid contracts or services or because all contracts/services were discovered to exist in /reference assemblies. 如果您尝试生成客户端,这可能是因为元数据文档不包含任何有效的合同或服务,或者因为发现所有合同/服务都存在于/ reference程序集中。 Verify that you passed all the metadata documents to the tool. 验证是否已将所有元数据文档传递给该工具。

Warning: If you would like to generate data contracts from schemas make sure to use the /dataContractOnly option. 警告:如果要从模式生成数据协定,请确保使用/ dataContractOnly选项。 Has anyone an idea what causes this problem? 有谁知道导致这个问题的原因是什么?

I'm seeing the same issue. 我看到了同样的问题。 I have a set of 30-odd wsdl files in a folder and am trying to create C# client classes for them all. 我在一个文件夹中有一组30多个wsdl文件,我正在尝试为它们创建C#客户端类。

If I do the following 如果我做以下事情

svcutil /noconfig /namespace:*,My.Required.Namespace *.wsdl

I see a lot of the error you mention (Cannot import wsdl:binding). 我看到你提到的很多错误(无法导入wsdl:binding)。

However, picking one file at a time 但是,一次选择一个文件

svcutil /noconfig /namespace:*,My.Required.Namespace a.wsdl

Frequently works; 经常工作; sometimes I have to include another file, eg 有时我必须包含另一个文件,例如

svcutil /noconfig /namespace:*,My.Required.Namespace b.wsdl c.wsdl

This is necessary when attempting to run svcutil on b.wsdl fails due to a dependency on c.wsdl. 当尝试在b.wsdl上运行svcutil时由于依赖于c.wsdl而失败,这是必要的。

Bottom line: I am not sure why I can't create contracts for all of these service definitions in one go, but it doesn't seem possible. 一句话:我不确定为什么我不能一次性为所有这些服务定义创建合同,但似乎不可能。 I still have a big problem with shared types across the files; 我对文件中的共享类型仍然存在很大问题; this means I effectively have to edit either third-party wsdl or the automatically generated code in order to get things to compile and run correctly. 这意味着我实际上必须编辑第三方wsdl或自动生成的代码,以便编译和正确运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM