无法连接到远程计算机上的 IIS 服务器

Can't connect to IIS server on remote machine

我已经在 remonte 机器上创建了 iis 服务器 (Windows Server 2008 R2)。这是我的 web.config:

  <system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="Binding" closeTimeout="00:05:00" sendTimeout="00:10:00" />
  </wsHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="DictionaryServiceBehaviors">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<services>
  <service behaviorConfiguration="DictionaryServiceBehaviors" name="BandD.Serwis.SerwisISS.Service.DictionariesService">
    <endpoint address=""
              binding="wsHttpBinding"
              contract="BandD.Serwis.SerwisISS.Interface.IDictionariesService"
              bindingConfiguration="Binding"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    <host>
      <baseAddresses>
        <add baseAddress="http://xxx.xxx.199.89:7833/BandD.Serwis.SerwisISS.Service/DictionariesService/"/>
      </baseAddresses>
    </host>
  </service>
</services>

即 app.config 客户端应用程序:

  <system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="WSHttpBinding_IDictionariesService" />
  </wsHttpBinding>
</bindings>
<client>
  <endpoint address="http://xxx.xxx.199.89:7833/Service/DictionariesService.svc"
      binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IDictionariesService"
      contract="DictionariesService.IDictionariesService" name="WSHttpBinding_IDictionariesService">
  </endpoint>
</client>

我已将 IIS 服务器角色添加到我的远程计算机,我设置了物理路径以从服务器应用程序(从 VS 发布)中查找发布的文件。我将所有身份验证设置为禁用,仅启用匿名身份验证。

当我尝试使用 SoapUi 连接到 WSDL 时出现错误:

Error getting response; java.net.UnknowsHostException: winserver2008

当我想用客户端应用程序连接到服务器时,我必须输入用户名和密码(管理员密码不起作用)。 我必须做什么才能在没有身份验证的情况下连接到服务器。我应该在服务器(Windows 服务器)或 app.config 上更改什么才能正确连接。

可能我有床web/app.config

好的,我找到了解决方案: 在 MS Server 上,我现在将网站连接为(在基本设置中)管理员。这只是暂时的,我稍后会更改它。 其次,我在服务器上更改 web.config:

  <system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="Binding" closeTimeout="00:05:00" sendTimeout="00:10:00">
      <security mode="None" />
      <reliableSession enabled="true" />
    </binding>
  </wsHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="DictionaryServiceBehaviors">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<services>
  <service behaviorConfiguration="DictionaryServiceBehaviors" name="BandD.Serwis.SerwisISS.Service.DictionariesService">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="Binding"
      contract="BandD.Serwis.SerwisISS.Interface.IDictionariesService" />
    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
      name="mex" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://http://xxx.xxx.199.89:7833/Service/DictionariesService" />
      </baseAddresses>
      <timeouts closeTimeout="00:01:00" openTimeout="00:10:00" />
    </host>
  </service>
</services>

最后我更改了客户端应用程序配置:

<system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="WSHttpBinding_IDictionariesService">
                <reliableSession enabled="true" />
                <security mode="None" />
            </binding>
        </wsHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://xxx.xxx.199.89:7833/Service/DictionariesService.svc"
            binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IDictionariesService"
            contract="DictionariesService.IDictionariesService" name="WSHttpBinding_IDictionariesService" />
    </client>
</system.serviceModel>