2017-02-25 228 views
0

我已經在remonte機器上創建iis服務器(Windows Server 2008 R2)。這是我的web.config:無法連接到遠程機器上的IIS服務器

<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上更改以正確連接。

可能是我的牀網/的app.config

+0

[上IIS主機WCF服務應用程序]的可能的複製(HTTP:/ /stackoverflow.com/questions/20674398/host-wcf-service-application-on-iis) – David

+0

這是somthin others,因爲我已經創建了WCF servis並且我託管它,但是我無法連接到它。 – Newer

回答

0

好吧,我找到解決辦法: 在MS服務器更改我現在的網站連接爲(以巴西奇設置)管理員。這只是現在,我以後改變它。 其次,我改變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> 
相關問題