2011-05-26 32 views
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]&#xD;&#xA;" /> 
      <param name="Footer" value="[Footer]&#xD;&#xA;" /> 
      <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" /> 
     </layout> 
     </appender> 
     <root> 
     <level value="DEBUG" /> 
     <appender-ref ref="LogFileAppender" /> 
     </root> 
    </log4net> 
</configuration> 

我得到这个设置了不同的机器,确实有网络连接

回答

1

你的问题是,你有你的wsHttp结合,利用客户端的Windows凭据配置信息安全上运行的虚拟机,但服务器无法识别客户端的Windows凭据,因为服务器的域与客户端VM上的本地安全权限之间没有域信任。

如果虚拟机无法加入与服务器相同的域,则需要更改为使用不同的凭据(如客户机证书)或禁用消息安全性。

+0

我在客户端的配置中设置了,但是在打开的配置中(1分钟时间)它超时了 – 2011-05-26 18:01:46

+0

好吧,看起来我必须设置在客户端和服务中。我知道这并不理想,但我这样做只是为了连接虚拟机世界中的连接。 虽然空的标记就足够了,但这是类似的问题,具有相同的解决方案http://social.msdn.microsoft.com/forums/en-US/wcf/thread/271b1816-173c -4c76-a4c4-fd9fda4b5e91 / – 2011-05-26 18:28:50