gpt4 book ai didi

c# - 添加服务引用会生成空的 reference.cs 和空的 config.svcinfo 文件

转载 作者:太空宇宙 更新时间:2023-11-03 15:59:52 25 4
gpt4 key购买 nike

我正在尝试连接到此 Web 服务:http://www.eotd.org/search/server/terminology-service-soap.wsdl

网络服务网站:http://www.eccma.org/resources/webservices.php

当我在 C# 中添加服务引用时,生成的 reference.cs 文件为空,并且 config.svcinfo 和 config91.svcinfo 在其行为、绑定(bind)和端点中没有任何内容。此外,不确定为什么在创建的服务引用中有两个不同的 wsdl 文件。

我已经尝试过 SO 上发布的解决方案,例如取消选中“在引用的程序集中重用类型”并将集合类型更改为 Generic.List,但到目前为止没有任何效果。

任何人都可以连接到这个网络服务吗?关于问题是什么的任何想法?

最佳答案

我使用命令 svcutil http://www.eotd.org/search/server/terminology-service-soap.wsdl 运行 svcutil 并得到以下错误:

C:\temp>svcutil http://www.eotd.org/search/server/terminology-service-soap.wsdl Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.33440] Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'http://www.eotd.org/search/server/terminology-service-soap.wsdl' using WS-Metadata Exchange or DISCO. Error: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter Error: Schema with target namespace 'urn:iso:std:iso:ts:29002:-20:ed-1:tech:xml-schema:resolution-service-data' could not be found. XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:iso:std:iso:ts:29002:-20:ed-1:tech:web-service:terminology-service']/wsdl:portType[@na me='terminology_service']

Error: 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='urn:iso:std:iso:ts:29002:-20:ed-1:tech:web-service:terminology-service']/wsdl:portType[@n ame='terminology_service'] XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:iso:std:iso:ts:29002:-20:ed-1:tech:web-service:terminology-service:soap']/wsdl:binding [@name='terminology_service_SOAP_binding']

Error: 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='urn:iso:std:iso:ts:29002:-20:ed-1:tech:web-service:terminology-service:soap']/wsdl:binding [@name='terminology_service_SOAP_binding'] XPath to Error Source: //wsdl:definitions[@targetNamespace='urn:iso:std:iso:ts:29002:-20:ed-1:tech:web-service:terminology-service:soap']/wsdl:service [@name='terminology_service']/wsdl:port[@name='terminology_service_port']

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. 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.

关于c# - 添加服务引用会生成空的 reference.cs 和空的 config.svcinfo 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21924240/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com