首页 > 代码库 > IIS部署WCF服务

IIS部署WCF服务

1.在站点下新建.svc文件。

<%@ ServiceHost Language="C#" Debug="true" Service="IPP_PCL_Web.WCF.Services.PCLServerService" %>

2.修改web.config文件

  <system.serviceModel>    <behaviors>      <serviceBehaviors>        <behavior name="metaDataBehavior">          <serviceMetadata httpGetEnabled="true"/>        </behavior>      </serviceBehaviors>    </behaviors>        <services>      <service name="IPP_PCL_Web.WCF.Services.PCLServerService" behaviorConfiguration="metaDataBehavior">        <endpoint binding="basicHttpBinding" contract="IPP_PCL_Web.WCF.Contracts.IPCLServerService"></endpoint>      </service>    </services>  </system.serviceModel>

 

IIS部署WCF服务