У меня была проблема с тестом WCF, и проблема была решена, когда я перешел в начало system.servicemodel.
Мой вопрос: почему это важно? Разве .NET не читает XML по именам полей?
<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>