2013-03-22 200 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