2013-03-22 201 views
1

Web.config文件上开发调用另一个远程开发服务器上的Web服务,因此结合看起来像这样改变QA期间在asp.net的web.config httptransport标签或督促

<binding name="XXXSoap12"> 
    <httpsTransport manualAddressing="false" maxBufferPoolSize="524288" 
     maxReceivedMessageSize="1048576" allowCookies="false" 
     authenticationScheme="Anonymous" 
     bypassProxyOnLocal="false" decompressionEnabled="true" 
     hostNameComparisonMode="StrongWildcard" 
     keepAliveEnabled="true" maxBufferSize="1048576" 
     proxyAuthenticationScheme="Anonymous" 
     realm="" transferMode="Buffered" 
     unsafeConnectionNtlmAuthentication="false" 
     useDefaultWebProxy="true" /> 
</binding> 

我想改变httpTransport协议/标签至httpsTransport协议用于QA,STG & PROD。

如何为同一个书写转换。

回答

1

在Web.Release.config(或Web.QA.config,或Web.STG.config或其他变换):

<binding name="XXXSoap12"> 

    <httpTransport xdt:Transform="Remove" /> 

    <httpsTransport xdt:Transform="Insert" 
     manualAddressing="false" maxBufferPoolSize="524288" 
     maxReceivedMessageSize="1048576" allowCookies="false" 
     authenticationScheme="Anonymous" 
     bypassProxyOnLocal="false" decompressionEnabled="true" 
     hostNameComparisonMode="StrongWildcard" 
     keepAliveEnabled="true" maxBufferSize="1048576" 
     proxyAuthenticationScheme="Anonymous" 
     realm="" transferMode="Buffered" 
     unsafeConnectionNtlmAuthentication="false" 
     useDefaultWebProxy="true" /> 

</binding> 

您也可以read this to learn more about config transforms