<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="NoneSecurity"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" useDefaultWebProxy="false">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647"/>
<security mode="None"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="Service.TestService" behaviorConfiguration="metadataBehavior">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="NoneSecurity" contract="Contract.ServiceContract.ITestService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
<serviceActivations>
<add relativeAddress="TestService.svc"
service="Service.TestService"/>
</serviceActivations>
</serviceHostingEnvironment>
</system.serviceModel>
如果是在MVC中,需要添加路由:routes.IgnoreRoute("{resource}.svc/{*pathInfo}");
本文详细介绍了Windows Communication Foundation (WCF)服务的配置方法,包括如何设置无安全性的基本HTTP绑定、服务行为、元数据发布及调试选项等,并提供了在ASP.NET MVC环境中使用WCF服务的示例。
709

被折叠的 条评论
为什么被折叠?



