2013-03-21 51 views
0
<system.serviceModel> 
    <services> 
    <service name="Coevery.Services.Document.DocumentService" 
      behaviorConfiguration="aaa"> 
     <endpoint address="" 
       binding="basicHttpBinding" 
       bindingConfiguration="documentbinding" 
       contract="Coevery.Services.Document.IDocumentService"> 
     </endpoint> 
    </service> 
    </services> 
    <bindings> 
    <basicHttpBinding> 
     <binding maxBufferPoolSize="2147483647" 
       maxReceivedMessageSize="2147483647" 
       allowCookies="true"> 
     <security mode="None"> 
     </security> 
     <readerQuotas maxArrayLength="2147483647" 
         maxNameTableCharCount="2147483647" 
         maxStringContentLength="2147483647" 
         maxDepth="2147483647" 
         maxBytesPerRead="2147483647" /> 
     </binding> 
     <binding name="documentbinding" 
       closeTimeout="04:01:00" 
       openTimeout="04:01:00" 
       receiveTimeout="04:10:00" 
       sendTimeout="04:01:00" 
       allowCookies="false" 
       bypassProxyOnLocal="false" 
       hostNameComparisonMode="StrongWildcard" 
       maxBufferSize="2147483647" 
       maxBufferPoolSize="2147483647" 
       maxReceivedMessageSize="2147483647" 
       messageEncoding="Mtom" 
       textEncoding="utf-8" 
       useDefaultWebProxy="true"> 
     <readerQuotas maxDepth="2147483647" 
         maxStringContentLength="2147483647" 
         maxArrayLength="2147483647" 
         maxBytesPerRead="2147483647" 
         maxNameTableCharCount="2147483647" /> 
     </binding> 
    </basicHttpBinding> 
    </bindings> 
    <behaviors> 
    <serviceBehaviors> 
     <behavior name="aaa"> 
     <serviceSecurityAudit auditLogLocation="Application" 
           serviceAuthorizationAuditLevel="Failure" 
           messageAuthenticationAuditLevel="Failure" 
           suppressAuditFailure="true" /> 
     <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
     <serviceMetadata httpGetEnabled="true" /> 
     <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     <serviceCredentials> 
      <serviceCertificate findValue="WCfServer" 
           storeLocation="LocalMachine" 
           storeName="TrustedPeople" 
           x509FindType="FindBySubjectName"/> 
     </serviceCredentials> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
     </behavior> 
    </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="True" /> 
</system.serviceModel> 

如果行爲名稱=「AAA」 =>元數據爲這項服務發佈當前已禁用。 但沒有名字,那就沒關係。WCF怪異的行爲

有誰知道這有什麼錯呢? d

+1

試試這個:在行爲保留名稱(AAA),並添加一個MEX終結,看看它的工作原理呢。 @voo大約是默認行爲下面是正確的,但因爲你引用了服務標籤的行爲,我不是100%肯定它是一個WCF違約問題。 – Tim 2013-03-21 05:51:30

回答

1

這是WCF 4的功能,當你ommit名稱,WCF服務認爲這是一個默認的行爲:我開始使用WCF每當丟失。見http://msdn.microsoft.com/en-us/library/ee354381.aspx

在WCF 3.x中,你必須定義你 明確通過 「behaviorConfiguration」屬性適用於服務和端點名字的行爲配置。有了WCF 4,你可以通過在配置 定義忽略的名字定義默認行爲 配置。如果添加這些默認行爲,Machine.config並 他們會應用到託管計算機上的所有服務或端點。

+0

但是,在上面的配置文件中,服務專門引用了指定的服務行爲。所以它不應該是一個默認的行爲問題。我想知道如果OP保持名稱並添加了mex端點,它是否會起作用? – Tim 2013-03-21 05:49:41

+0

@Tim是的,你有問題。 Mex點缺失。 – Alex 2013-03-21 05:59:11