両方で同じバインディングを使用していますか?その場合は、2つの別々のバインディングを試してください。1つはmexエンドポイント用で、もう1つはwshttp用です。
したがって、サービスの場合-次のようなものです。
<wsHttpBinding><binding name="wsHttpBindingMessageUname">
<security mode="Message">
<message clientCredentialType="UserName" negotiateServiceCredential="true"
establishSecurityContext="false" />
</security></binding></wsHttpBinding>
およびmexエンドポイント(セキュリティなし)の場合:
<customBinding><binding name="customMex">
<textMessageEncoding>
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</textMessageEncoding>
<httpTransport transferMode="Buffered"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"/></binding></customBinding>
サービスエンドポイントは次のようになります。
<endpoint address="" behaviorConfiguration="Server.Services.DefaultEndpointBehavior" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingMessageUname" name="DefaultHttp" contract="Server.Services.IMyService" listenUriMode="Explicit" />
<endpoint address="mex" binding="customBinding" contract="IMetadataExchange" name="" bindingConfiguration="customMex" listenUriMode="Explicit" />
この設定では、mexのセキュリティが適用されていないため、サービス参照を更新しようとしたときにそのメッセージが表示されないようにする必要があります。それか、異なる資格情報、つまりマシン上のクライアント証明書を使用する別の安全なバインディングを作成します。
次のMSDN投稿には、このサンプルがあります。安全なmexエンドポイントに関する詳細については、このブログを参照してください。