我已经开发了一个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
我猜测这是错误的问题地址,但我不知道哪里是错误... 有人可以看看这个问题...