2009-09-15 21 views
0

我有一個WCF測試問題,並且當我移動到system.servicemodel的頂部時,問題就解決了。 我的問題是,爲什麼這很重要? .NET不是按字段名讀取XML的?爲什麼它關係app.config中的哪些訂單設置

<system.serviceModel> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="MyServiceTypeBehaviors"> 
     <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<bindings> 
    <basicHttpBinding> 
    <!-- Server--> 
    <binding 
     name="ws" 
     transferMode="Streamed" 
     messageEncoding="Mtom" 
     maxReceivedMessageSize="10067108864" 
     maxBufferSize="500000" 
     maxBufferPoolSize="500000" 
     receiveTimeout="10:00:00" 
     sendTimeout="10:00:00" 
     closeTimeout="10:00:00" 
     openTimeout="10:00:00"> 
     <readerQuotas 
     maxDepth="32" 
     maxStringContentLength="2147483647" 
     maxArrayLength="2147483647" 
     maxBytesPerRead="4096" 
     maxNameTableCharCount="16384" /> 
     <security mode="None"> 
     <transport clientCredentialType="None"/> 
     </security> 
    </binding> 

    <!-- Server --> 
     <binding 
     name="FileTransferServicesBinding" 
     transferMode="Streamed" 
     messageEncoding="Mtom" 
     maxReceivedMessageSize="10067108864" 
     maxBufferSize="500000" 
     maxBufferPoolSize="500000"> 
     <readerQuotas 
      maxDepth="32" 
      maxStringContentLength="655360" 
      maxArrayLength="655360" 
      maxBytesPerRead="4096" 
      maxNameTableCharCount="16384" /> 
     </binding> 

    </basicHttpBinding> 
</bindings> 

<!-- Server --> 
<services> 
    <service behaviorConfiguration="MyServiceTypeBehaviors" name="Namespace.Namespace"> 
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="FileTransferServicesBinding" contract="Namespace.INamespaceSC" /> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://localhost:8081/Namespace" /> 
     </baseAddresses> 
    </host> 
    <endpoint address="mex" binding="mexHttpBinding" contract="Namespace.INamespaceSC" /> 
    </service> 
</services> 

<!-- Behaviors field was here before, when it didn't work --> 

<!-- Client --> 
<client> 
    <endpoint 
    address="http://localhost:8081/Namespace" 
    binding="basicHttpBinding" 
    bindingConfiguration="ws" 
    contract="Namespace.INamespaceSC" 
    /> 
</client></system.serviceModel> 
+1

你能告訴我們原始的和修改的配置文件嗎? – 2009-09-15 07:16:22

回答

0

我不認爲訂單很重要!我已經開發了很多WCF服務,並且從未見過這種行爲......

0

訂單僅在服務或端點配置方面很重要,而您並未命名要使用的配置。在這種情況下,WCF將使用最匹配的配置。

我沒有理由移動行爲部分會有所作爲。我經常把它們放在靠近底部的地方。

+0

他們都被命名。 – Tuoski 2009-09-15 07:22:16

相關問題