在ServiceModel客户端配置部分中找不到名称为"IModelWcfServiceContract"和合同为"IModelWcfServiceContract"的终结点元素.这可能是因为找不到您的应用程序的配置文件,或者是因为没有endpoi [英] Could not find endpoint element with name 'IModelWcfServiceContract' and contract 'IModelWcfServiceContract' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoi

查看:160
本文介绍了在ServiceModel客户端配置部分中找不到名称为"IModelWcfServiceContract"和合同为"IModelWcfServiceContract"的终结点元素.这可能是因为找不到您的应用程序的配置文件,或者是因为没有endpoi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我正在处理基本WCF服务-客户端WCF服务-消费者基本Wcf服务模型,如下所示:

在此模型中,我创建了一个基本WCF服务并创建了1个WCF服务,即; ClientWCFService和1个ASMX服务,即;使用BaseWCFServiceProxy.cs的ClientASMXservice,使用SVCUtil.exe的Base WCF服务的Proxy类.

ClientWCFService和ClientASMXservice在StandAlone环境中运行良好.

现在,我使用相同的代理类BaseWCFServiceProxy.cs创建了一个消费者控制台应用程序,以使用BaseWcfService类访问ClientWCFService和ClientASMXservice.

根据OOP规则,BaseWcfService类是ClientWCFService和ClientASMXservice的基类,我可以使用Base服务类构造函数来访问这些服务.

服务电话如下:

用于ClientWCFService

ModelWcfServiceContractClient _client = new ModelWcfServiceContractClient("IModelWcfServiceContract","http://localhost:64242/ClientWCFServiceWcfUsingSVCProxy.svc");

对于ClientASMXservice

ModelWcfServiceContractClient _client = new ModelWcfServiceContractClient("IModelWcfServiceContract","http://localhost:64396/ClientASMXServiceWcfUsingSVCProxy.asmx");

使用者控制台应用程序可以正常运行,但是在运行时初始化ModelWCFServiceContractClient对象时,它会抛出 InvalidOperation 例外:

在ServiceModel客户端配置部分中找不到名称为"IModelWcfServiceContract"和合同为"IModelWcfServiceContract"的终结点元素.这可能是因为找不到您的应用程序的配置文件,或者 因为在客户端元素中找不到与该名称匹配的终结点元素.

我尝试为每种类型的服务使用不同的端点来解决此问题,但无法成功.

更快的响应将是 赞赏.另外,请不要仅仅通过清除拼写错误来帮助我,因为这将浪费我的时间来阅读由于清除拼写错误而生成的警报.时间对我来说至关重要.

谢谢


rupendra sharma

解决方案

你好,

我正在使用Base WCF Service-Client WCF服务-消费者基本Wcf服务模型如下:

在此模型中,我创建了一个基本WCF服务并创建了1个WCF服务,即; ClientWCFService和1个ASMX服务,即; ClientASMXservice使用 使用SVCUtil.exe将BaseWCFServiceProxy.cs用作基础WCF服务的代理类.

ClientWCFService和ClientASMXservice在StandAlone环境中运行良好.

现在,我使用相同的代理类BaseWCFServiceProxy.cs来访问ClientWCFService  和ClientASMXservice使用BaseWcfService类.

根据OOP规则,BaseWcfService类是ClientWCFService和ClientASMXservice的基类,我可以访问 这些服务使用基本服务类构造函数.

服务调用如下:

用于ClientWCFService

ModelWcfServiceContractClient _client = new ModelWcfServiceContractClient("IModelWcfServiceContract","http://localhost:64242/ClientWCFServiceWcfUsingSVCProxy.svc");

对于ClientASMXservice

ModelWcfServiceContractClient _client = new ModelWcfServiceContractClient("IModelWcfServiceContract"; ,"http://localhost:64396/ClientASMXServiceWcfUsingSVCProxy.asmx");

Consumer Console应用程序可以正常运行,但是在在初始化ModelWCFServiceContractClient对象时运行时,它会抛出 InvalidOperation > 例外 为:

找不到名称为'IModelWcfServiceContract'的终结点元素和在ServiceModel客户端配置中约定'IModelWcfServiceContract' 部分.这可能是因为找不到应用程序的配置文件,或者是因为在客户端元素中找不到与该名称匹配的终结点元素.

我尝试为每种类型的终端使用不同的端点服务来解决此问题,但无法成功.

需要更快的响应速度.另外,请不要仅仅通过清除拼写错误来帮助我,因为这会浪费我的时间来阅读本书. 由于清除拼写错误而产生的警报.时间对我来说至关重要.

谢谢


Hello,

I am working on a Base WCF Service- Client WCF service - Consumer Base Wcf servcie model as following:

In this model, I have created a Base WCF service and created 1 WCF service i.e; ClientWCFService and 1 ASMX service i.e; ClientASMXservice using the BaseWCFServiceProxy.cs the Proxy class of Base WCF Service using SVCUtil.exe.

The ClientWCFService  and ClientASMXservice  are working fine in StandAlone environment.

Now, I created a Consumer Console Application using the same proxy class BaseWCFServiceProxy.cs to access both of the ClientWCFService  and ClientASMXservice using the BaseWcfService class.

As per the OOP rules, BaseWcfService class is the base class for the ClientWCFService  and ClientASMXservice and i can access these Services using the Base service class constructor.

The service calls are as following:

for ClientWCFService

 ModelWcfServiceContractClient _client = new ModelWcfServiceContractClient("IModelWcfServiceContract","http://localhost:64242/ClientWCFServiceWcfUsingSVCProxy.svc");

for ClientASMXservice 

ModelWcfServiceContractClient _client = new ModelWcfServiceContractClient("IModelWcfServiceContract","http://localhost:64396/ClientASMXServiceWcfUsingSVCProxy.asmx");

The Consumer Console application is building fine, but at run time while initializing the ModelWCFServiceContractClient object, it throws the InvalidOperation Exception as :

Could not find endpoint element with name 'IModelWcfServiceContract' and contract 'IModelWcfServiceContract' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.

I have tried using different endpoints for every type of service to resolve this issue but could not get success.

A faster response would be Appreciated. Also please don't help me by just clearing spelling mistakes because it will waste my time to read the Alert that would be generated due to the clearing spell mistakes. Time is critical for me..

Thanks


rupendra sharma

解决方案

Hello,

I am working on a Base WCF Service- Client WCF service - Consumer Base Wcf servcie model as following:


In this model, I have created a Base WCF service and created 1 WCF service i.e; ClientWCFService and 1 ASMX service i.e; ClientASMXservice using the BaseWCFServiceProxy.cs the Proxy class of Base WCF Service using SVCUtil.exe.

The ClientWCFService  and ClientASMXservice  are working fine in StandAlone environment.

Now, I created a Consumer Console Application using the same proxy class BaseWCFServiceProxy.cs to access both of the ClientWCFService  and ClientASMXservice using the BaseWcfService class.

As per the OOP rules, BaseWcfService class is the base class for the ClientWCFService  and ClientASMXservice and i can access these Services using the Base service class constructor.

The service calls are as following:

for ClientWCFService

 ModelWcfServiceContractClient _client = new ModelWcfServiceContractClient("IModelWcfServiceContract","http://localhost:64242/ClientWCFServiceWcfUsingSVCProxy.svc");

for ClientASMXservice 

ModelWcfServiceContractClient _client = new ModelWcfServiceContractClient("IModelWcfServiceContract","http://localhost:64396/ClientASMXServiceWcfUsingSVCProxy.asmx");

The Consumer Console application is building fine, but at run time while initializing the ModelWCFServiceContractClient object, it throws the InvalidOperation Exception as :

Could not find endpoint element with name 'IModelWcfServiceContract' and contract 'IModelWcfServiceContract' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.

I have tried using different endpoints for every type of service to resolve this issue but could not get success.

A faster response would be Appreciated. Also please don't help me by just clearing spelling mistakes because it will waste my time to read the Alert that would be generated due to the clearing spell mistakes. Time is critical for me..

Thanks


这篇关于在ServiceModel客户端配置部分中找不到名称为"IModelWcfServiceContract"和合同为"IModelWcfServiceContract"的终结点元素.这可能是因为找不到您的应用程序的配置文件,或者是因为没有endpoi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆