【发布时间】:2016-04-07 07:39:55
【问题描述】:
我正在尝试在 VS2010 中运行一个在本地调用 2 个 Web 服务的项目,我的 app.config 文件设置如下,并将 2 个 Web 服务添加到服务引用中,但是当我收到以下错误尝试进入其中一个 Web 服务中的代码。
只是想知道你能帮忙吗,我知道这个错误可能以前在这里出现过,但给出的解决方案似乎无法解决我的问题。
错误信息:
在 ServiceModel 客户端配置部分找不到名为“XXXXXX”和合同“IcxnService.IIcxnService”的端点元素。这可能是因为找不到您的应用程序的配置文件,或者因为在客户端元素中找不到与此名称匹配的端点元素。
App.Config文件:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IIcxnService"
closeTimeout="00:10:00" openTimeout="00:30:00"
receiveTimeout="00:30:00" sendTimeout="00:30:00"
bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384" maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<reliableSession ordered="true"
inactivityTimeout="00:10:00" enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows"
proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
<binding name="WSHttpBinding_ICznzrzctZzzzsService"
closeTimeout="00:10:00" openTimeout="00:10:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00"
bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384" maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<reliableSession enabled="false"
ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<transport clientCredentialType="Windows"
proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint name="WSHttpBinding_ICznzrzctZzzzsService"
address="http://localhost:1600/ContractNotes.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_ICznzrzctZzzzsService"
contract="ContractNotes.ICznzrzctZzzzsService" />
<endpoint name="WSHttpBinding_IIcxnService"
address="http://localhost:1000/IcxnService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IIcxnService"
contract="IcxnService.IIcxnService">
<identity>
<userPrincipalName value="john@xxxxxxx.COM" />
</identity>
</endpoint>
</client>
</system.serviceModel>
【问题讨论】:
标签: c# wcf wcf-binding