WCF配置问题

exinke 2015-10-26 10:26:35
<system.serviceModel>

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="false" minFreeMemoryPercentageToActivateService="10" />

<bindings>
<basicHttpBinding>
<binding name="binding1">
</binding>
</basicHttpBinding>
</bindings>
<services>

<service name="B1Service.AuthApi.Auth" behaviorConfiguration="behaviorConfiguration">
<endpoint address="http://localhost:54616/AuthApi/Auth.svc" name="ServiceReference_Run" binding="basicHttpBinding" bindingConfiguration="binding1" contract="B1Service.AuthApi.IAuth"></endpoint>
</service>
<service name="B1Service.SAPApi.SAPB1" behaviorConfiguration="behaviorConfiguration">
<endpoint address="http://localhost:54616/SAPApi/SAPB1.svc" name="ServiceReference_SAPB1" binding="basicHttpBinding" bindingConfiguration="binding1" contract="B1Service.SAPApi.ISAPB1"></endpoint>
</service>
<service name="B1Service.SQLApi.SQL" behaviorConfiguration="behaviorConfiguration">
<endpoint address="http://localhost:54616/SQLApi/SQL.svc" name="ServiceReference_SQL" binding="basicHttpBinding" bindingConfiguration="binding1" contract="B1Service.SQLApi.ISQL"></endpoint>
</service>

<service name="B1Service.Run" behaviorConfiguration="behaviorConfiguration">
<endpoint address="http://localhost:54616/Run.svc" name="ServiceReference_Run" binding="basicHttpBinding" bindingConfiguration="binding1" contract="B1Service.IRun"></endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="behaviorConfiguration">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https"/>
</protocolMapping>
</system.serviceModel>

如上的配置后,启动调试时报错:
错误: 无法从 http://localhost/B1Service/Run.svc 获取元数据如果是您有权访问的 Windows (R) Communication Foundation 服务,请检查是否已启用在指定地址发布元数据。有关启用元数据发布的帮助,请参阅 http://go.microsoft.com/fwlink/?LinkId=65455 上的 MSDN 文档。WS-Metadata Exchange 错误 URI: http://localhost/B1Service/Run.svc 元数据包含无法解析的引用:“http://localhost/B1Service/Run.svc”。 服务器未提供有意义的回复;这可能是由协定不匹配、会话过早关闭或内部服务器错误引起的。HTTP GET Error URI: http://localhost/B1Service/Run.svc 下载“http://localhost/B1Service/Run.svc”时出错。 请求失败,响应为空。



WCF的配置太复杂了吧。对于我这种不太会写程序的讲有点儿折磨人呀。

...全文
107 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
海会圣贤 2015-10-31
  • 打赏
  • 举报
回复
安全验证方式呢? https证书呢?
ajianchina 2015-10-27
  • 打赏
  • 举报
回复
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="false" minFreeMemoryPercentageToActivateService="10" />
  • 打赏
  • 举报
回复
其实wcf有配置工具的,vs工具里面默认就有有wcf服务配置工具,客户端的需要你自己查下,叫wcfclient

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧