0
我試圖讓客戶端連接到Windows服務中託管的WCF服務。客戶端運行在沒有網絡和無域的計算機上,Win XP SP3。計算機正在運行Win XP SP3的虛擬機,並且運行了前面提到的WCF服務。 VM配置爲「與主機共享網絡」。這兩臺機器可以互相ping通。調用者未通過虛擬機上的WCF服務中的服務進行身份驗證
我試過運行服務作爲一個LocalService並在真實機器和虛擬機上的用戶帳戶/密碼下運行它。
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="DllAnalyzer.DllAnalyzerClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<system.serviceModel>
<client>
<!--This is the endpoint to the VM Running the service -->
<endpoint address="http://192.168.224.1:8001/DllAnalyzerService/"
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IDllAnalyzerService"
contract="AnalyzerServiceReference.IDllAnalyzerService" name="WSDualHttpBinding_IDllAnalyzerService">
<identity>-->
<dns value="localhost" />
</identity>
</endpoint>
</client>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IDllAnalyzerService" closeTimeout="00:01:00"
openTimeout="00:01: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" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
</system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup><applicationSettings>
<DllAnalyzer.DllAnalyzerClient.Properties.Settings>
<setting name="UseSelfHostingService" serializeAs="String">
<value>True</value>
</setting>
</DllAnalyzer.DllAnalyzerClient.Properties.Settings>
</applicationSettings>
<log4net>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<param name="File" value="${USERPROFILE}\DLL Analysis Logs\ClientLog.txt" />
<param name="AppendToFile" value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="Header" value="[Header]
" />
<param name="Footer" value="[Footer]
" />
<param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="LogFileAppender" />
</root>
</log4net>
</configuration>
我得到這個設置了不同的機器,確實有網絡連接
我在客戶端的配置中設置了,但是在打開的配置中(1分鐘時間)它超時了 –
2011-05-26 18:01:46
好吧,看起來我必須設置在客戶端和服務中。我知道這並不理想,但我這樣做只是爲了連接虛擬機世界中的連接。 雖然空的標記就足夠了,但這是類似的問題,具有相同的解決方案http://social.msdn.microsoft.com/forums/en-US/wcf/thread/271b1816-173c -4c76-a4c4-fd9fda4b5e91 / –
2011-05-26 18:28:50