我已經開發了一個WCF服務,我必須託管在IIS它,作爲跟隨在使用IIS託管的wcf服務時出現問題?
<%@ ServiceHost Language="C#" Debug="true" Service="ServiceImplemetation.HelloService" %>
SVC文件和web.config文件的system.servicemodel部分如下:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MetadataBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>
<behavior name="WebApplication1.Service1Behavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<behavior name="WebApplication1.MyHelloBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="ServiceImplemetation.HelloService"
behaviorConfiguration="MetadataBehavior">
<endpoint address=""
binding="basicHttpBinding"
contract="ServiceContracts.IHello" />
<endpoint address="mex"
binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
服務優良運行,現在我已經創建了一個Web客戶端消費服務和如下所寫web.config文件的cleint部分:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="wsServiceBehaviour">
<dataContractSerializer maxItemsInObjectGraph="6553600"/>
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint address="http://localhost:8379/HelloService/"
binding="basicHttpBinding"
behaviorConfiguration="wsServiceBehaviour"
contract="ServiceContracts.IHello"
name="BasicHttpBinding_IIHello" />
</client>
</system.serviceModel>
現在,當我訪問這個服務我收到以下錯誤:
無連接可以作出,因爲目標機器積極地拒絕它127.0.0.1:8379
我猜測這是錯誤的問題地址,但我不知道哪裏是錯誤... 有人可以看看這個問題...