Reputation: 2700
I have this configuration in a WCF webservice:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:03:00" sendTimeout="00:03:00">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="200000" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://webserver/myService.svc" binding="basicHttpBinding" contract="IService" name="IService" />
<endpoint address="http://webserver/myService1.svc" binding="basicHttpBinding" contract="Documents.IDocService" name="Documents.IDocService" />
</client>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add scheme="http" binding="basicHttpBinding" />
</protocolMapping>
</system.serviceModel>
I am getting the following warning in a trace file (diagnostics svclog).
The configuration system has detected a duplicate key in a different configuration scope and is overriding with the more recent value.
and it points the following line:
<protocolMapping>
<add scheme="http" binding="basicHttpBinding" />
</protocolMapping>
I don't see what could be duplicated. Could you give me a hint what the issue is?
Upvotes: 1
Views: 546
Reputation: 166
This happen because you have another configuration section defining behavior for this protocol mapping. Using <clear/>
tag inside protocol mapping will remove the first config. This apply to all the same conflict, also appear in connection string among others. When you are calling one service as from another app, the upper level of config could overwrite some behavior in the second one...
Upvotes: 3
Reputation: 420
If you add a clear, then you remove duplicates:
<protocolMapping>
<clear/>
<add scheme="http" binding="basicHttpBinding" />
</protocolMapping>
like this.
Upvotes: 0