问题描述
我正在开发WCF Web服务.我希望能够在我的本地机器上使用它(出于调试目的,并将其部署到两个安全的网站.我提出了以下服务模型配置:< system.serviceModel > < 行为 > < serviceBehaviors > < 行为 名称 =" StdBehavior" > < serviceMetadata httpGetEnabled =" true" / > < serviceDebug includeExceptionDetailInFaults =" true" / > < /行为 > < /serviceBehaviors > < /行为 > < 绑定 > < basicHttpBinding > < 绑定 名称 =" secureBind" > < 安全性 模式 =" 运输" > < 运输 clientCredentialType =" 证书" / > < /security > < /binding > < /basicHttpBinding > < /bindings > < 服务 > < 服务 行为配置 =" StdBehavior" 名称 =" LocalSvc" > < 端点 合同 =" A.ICrisSvc" span> 名称 =" localEndpoint" span> 绑定 =" wsHttpBinding" 地址 =" " / > < 端点 合同 =" IMetadataExchange" 名称 =" mexEndpoint" span> 绑定 =" mexHttpBinding" 地址 =" mex" / > < /service > < 服务 行为配置 =" StdBehavior" 名称 =" DevSvc" > < 端点 合同 =" A.ICrisSvc" span> 名称 =" devEndpoint" 绑定 =" basicHttpBinding" bindingConfiguration =" secureBind" 地址 =" https://blah.mil/blah/CrisSvc" span> / > < /service > < 服务 行为配置 =" StdBehavior" 名称 =" ProductionSvc" > < 端点 合同 =" A.ICrisSvc" span> 名称 =" prodEndpoint" span> 绑定 =" basicHttpBinding" bindingConfiguration =" secureBind" span> 地址 =" https://blah2.mil/blah2/CrisSvc" span> / > < /service > < /服务 > < /system.serviceModel >
当我尝试向桌面应用程序添加服务引用时,出现以下错误:Service ''A.CrisSvc'' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.
在我看来,我拥有所有需要存放在其中的东西.如果删除两个https服务,则可以添加引用.我在做什么错?
I''me developing a WCF web service. I want to be able to use it on my local box (for debugging purposes, and deploy it to two secure web sites. I''ve come up with the following service model configuration:
<system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="StdBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <bindings> <basicHttpBinding > <binding name="secureBind"> <security mode="Transport"> <transport clientCredentialType="Certificate" /> </security> </binding> </basicHttpBinding> </bindings> <services> <service behaviorConfiguration="StdBehavior" name="LocalSvc"> <endpoint contract="A.ICrisSvc" name="localEndpoint" binding="wsHttpBinding" address="" /> <endpoint contract="IMetadataExchange" name="mexEndpoint" binding="mexHttpBinding" address="mex" /> </service> <service behaviorConfiguration="StdBehavior" name="DevSvc"> <endpoint contract="A.ICrisSvc" name="devEndpoint" binding="basicHttpBinding" bindingConfiguration="secureBind" address="https://blah.mil/blah/CrisSvc" /> </service> <service behaviorConfiguration="StdBehavior" name="ProductionSvc"> <endpoint contract="A.ICrisSvc" name="prodEndpoint" binding="basicHttpBinding" bindingConfiguration="secureBind" address="https://blah2.mil/blah2/CrisSvc" /> </service> </services> </system.serviceModel>
When I try to add a service reference to my desktop application, I get the following error:Service ''A.CrisSvc'' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.
It looks to me like I have everything in there that needs to be in there. If I remove the two https services, I can add the reference. What am I doing wrong?
这篇关于WCF Web服务-多种服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!