svc中写好接口方法

[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
       public 返回类型  方法名 (参数)
        {

        }

契约接口里面要注册这个方法

[ServiceContract]
   public interface 接口名
   {

    [OperationContract, WfJsonFormatter]

    public 返回类型  方法名 (参数)

   }

页面调用的时候需要先配置服务

<add key="Service" value="

接口的地址.svc"/>

页面后台调用接口

 EndpointAddress endpoint = new EndpointAddress(System.Configuration.ConfigurationManager.AppSettings["Service"]);
       
           using (var factory = new WfClientChannelFactory<契约接口>(endpoint))
           {
               service.要调用的接口方法
           }