1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 多版本Visual Studio 集成环境下的WCF 开发-服务库默认配置表

多版本Visual Studio 集成环境下的WCF 开发-服务库默认配置表

时间:2019-02-01 08:20:21

相关推荐

多版本Visual Studio 集成环境下的WCF 开发-服务库默认配置表

多版本Visual Studio 集成环境下的WCF 开发-服务库默认配置表

VisualStudio

VisualStudio只有服务库,而没有服务应用程序,其服务库生成配置文件关联项为

<system.serviceModel>

<services>

<service name="WcfServiceLibrary1.Service1" behaviorConfiguration="WcfServiceLibrary1.Service1Behavior">

<host>

<baseAddresses>

<add baseAddress = "http://localhost:8731/Design_Time_Addresses/WcfServiceLibrary1/Service1/" />

</baseAddresses>

</host>

<!-- Service Endpoints -->

<!-- 除非完全限定,否则地址将与上面提供的基址相关 -->

<endpoint address ="" binding="wsHttpBinding" contract="WcfServiceLibrary1.IService1">

<!--

部署时,应删除或替换下列标识元素,以反映

在其下运行部署服务的标识。删除之后,WCF 将

自动推导相应标识。

-->

<identity>

<dns value="localhost"/>

</identity>

</endpoint>

<!-- Metadata Endpoints -->

<!-- 元数据交换终结点由服务用于向客户端做自我描述。-->

<!-- 此终结点不使用安全绑定,应在部署前确保其安全或将其删除-->

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

</service>

</services>

<behaviors>

<serviceBehaviors>

<behavior name="WcfServiceLibrary1.Service1Behavior">

<!-- 为避免泄漏元数据信息,

请在部署前将以下值设置为 false 并删除上面的元数据终结点 -->

<serviceMetadata httpGetEnabled="True"/>

<!-- 要接收故障异常详细信息以进行调试,

请将下值设置为 true。在部署前

设置为 false 以避免泄漏异常信息-->

<serviceDebug includeExceptionDetailInFaults="False" />

</behavior>

</serviceBehaviors>

</behaviors>

</system.serviceModel>

VisualStudio

其服务库生成配置文件关联项与 VisualStudio 一致

VisualStudio

<system.serviceModel>

<services>

<service name="WcfServiceLibrary1.Service1">

<host>

<baseAddresses>

<add baseAddress = "http://localhost:8733/Design_Time_Addresses/WcfServiceLibrary1/Service1/" />

</baseAddresses>

</host>

<!-- Service Endpoints -->

<!-- 除非完全限定,否则地址将与上面提供的基址相关 -->

<endpoint address="" binding="basicHttpBinding" contract="WcfServiceLibrary1.IService1">

<!--

部署时,应删除或替换下列标识元素,以反映

用来运行所部署服务的标识。删除之后,WCF 将

自动推断相应标识。

-->

<identity>

<dns value="localhost"/>

</identity>

</endpoint>

<!-- Metadata Endpoints -->

<!-- 元数据交换终结点供相应的服务用于向客户端做自我介绍。 -->

<!-- 此终结点不使用安全绑定,应在部署前确保其安全或将其删除-->

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

</service>

</services>

<behaviors>

<serviceBehaviors>

<behavior>

<!-- 为避免泄漏元数据信息,

请在部署前将以下值设置为 false -->

<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>

<!-- 要接收故障异常详细信息以进行调试,

请将以下值设置为 true。在部署前设置为 false

以避免泄漏异常信息-->

<serviceDebug includeExceptionDetailInFaults="False" />

</behavior>

</serviceBehaviors>

</behaviors>

</system.serviceModel>

VisualStudio、VisualStudio

其服务库生成配置文件关联项与 VisualStudio 一致

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。