WCF 서비스 인 APi를 빌드했습니다.WCF 서비스 사용자 지정 값 대신 기본값으로 바인딩하기
다음 내가이 엔드 포인트 태그의 "name"속성을 설정하여 지정한 바인딩을 사용하는 구성을 말하는<bindings>
<wsHttpBinding>
<binding name="FxBinding"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
closeTimeout="00:20:00"
openTimeout="00:20:00"
receiveTimeout="00:20:00"
sendTimeout="00:20:00"
messageEncoding="Mtom">
<readerQuotas
maxDepth="64"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<security mode="None"></security>
</binding>
</wsHttpBinding>
</bindings>
: 서비스에 대한 Web.config에서 나는이처럼 보이는 bindong 정의를 지정
<services>
<service name="Dba.Admanager.Api.ListingServiceContract" behaviorConfiguration="Dba.Admanager.Api.ListingServiceContractBehavior">
<endpoint address="" binding="wsHttpBinding" name="FxBinding" contract="Dba.Admanager.ApplicationController.Api.IListingServiceContract">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
참조. VS2008에서 서비스에 대한 웹 참조를 만들 때 app.config가 생성됩니다. 이 app.config에서 사용되는 바인딩은 위에서 지정한 것이어야합니다. 하지만 app.config 파일의 기본 바인딩은 "maxArrayLength"에 예를 들어 있습니다.
<bindings>
<wsHttpBinding>
<binding name="FxBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://l-aar-00424012.corp.ebay.com/Admanager.Api/ListingServiceContract.svc"
binding="wsHttpBinding" bindingConfiguration="FxBinding" contract="WCFListingServiceContract.IListingServiceContract"
name="FxBinding">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
나는 클라이언트가 FxBinding 구성을 사용하고있는 것을 볼 수있다. 그러나 지구상의 모든 값은 왜 기본값인지 모르겠다. anobody가 바인딩 값을 커스터마이징하고 "클라이언트"부분에 반영하는 방법에 대한 단서를 제공 할 수 있습니까?
app.config에서 manualle 값을 변경하면 원하는 효과를 얻을 수 있지만 웹 참조가 업데이트 될 때마다 VS는 기본값으로 새 바인딩을 추가합니다.
Thancs marc_s. 이것은 좋은 가치 정보이며 config evne을 더 읽기 쉽게 만듭니다. Plus : 두 구성을 동기화 상태로 유지하는 데 어려움을 덜어줍니다. – esbenr