我有一個WCF服務設置,我可以使用它作爲intendid ...但只能在同一臺機器上使用。我期望在多臺計算機上工作,並且我對安全性不感興趣。然而,當我設置(客戶端)的安全性=無,我得到一個InvalidOperationException異常:沒有安全性的WCF
服務證書並沒有提供目標 「http://xxx.xxx.xxx.xxx:8731/Design_Time_Addresses/WcfServiceLibrary/ManagementService/」 。 在 ClientCredentials中指定服務證書。
所以我留下了:
<security mode="Message">
<message clientCredentialType="None" negotiateServiceCredential="false"
algorithmSuite="Default" />
</security>
但是這給了我另一個InvalidOperationException異常:
服務證書不 提供目標 'http://xxx.xxx.xxx.xxx:8731/Design_Time_Addresses/WcfServiceLibrary/ManagementService/'。 在 ClientCredentials中指定服務證書。
爲什麼我要在安全關閉的情況下提供證書?
更新:
服務器應用程序配置:
<system.serviceModel>
<services>
<service name="Server.WcfServiceLibrary.ManagementService" behaviorConfiguration="Server.WcfServiceLibrary.ManagementServiceBehavior">
<host>
<baseAddresses>
<add baseAddress = "http://localhost:8731/Design_Time_Addresses/WcfServiceLibrary/ManagementService/" />
</baseAddresses>
</host>
<endpoint address ="" binding="wsDualHttpBinding" contract="Server.WcfServiceLibrary.IManagementService"
bindingConfiguration="WSDualHttpBinding_IManagementService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IManagementService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:00:10"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="None" />
</binding>
</wsDualHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Server.WcfServiceLibrary.ManagementServiceBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
客戶端應用程序配置:
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IManagementService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="None" />
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://xxx:8731/Design_Time_Addresses/WcfServiceLibrary/ManagementService/"
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IManagementService"
contract="ServiceReference.IManagementService">
<!--name="WSDualHttpBinding_IManagementService">-->
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
感謝
更新問題,謝謝! – 2010-04-21 13:25:25
好的,謝謝,是的,有雙重http綁定的原因,但atm我不記得爲什麼!是的,我知道安全=沒有。謝謝,如果在10分鐘內工作,我會更新! :) – 2010-04-21 13:36:08
目前我可以配置服務引用到我的服務器,但是當我運行我只是得到一個超時:(任何想法爲什麼? – 2010-04-21 13:51:01