Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 找不到服务终结点_C#_Ajax_Wcf_Sharepoint - Fatal编程技术网

C# 找不到服务终结点

C# 找不到服务终结点,c#,ajax,wcf,sharepoint,C#,Ajax,Wcf,Sharepoint,我在生产辅助服务器中获得了低于WCF方法的“未找到服务终结点”错误,但在主服务器中也是如此 [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, Response

我在生产辅助服务器中获得了低于WCF方法的“未找到服务终结点”错误,但在主服务器中也是如此

[OperationContract]
        [WebInvoke(Method = "POST",
                    BodyStyle = WebMessageBodyStyle.Wrapped,
                    RequestFormat = WebMessageFormat.Json,
                    ResponseFormat = WebMessageFormat.Json,
                    UriTemplate = "/Alerts/Information")]
        [FaultContract(typeof(Fault))]
        Message SetEmailAlertInfo(Stream emailAlertInfo);
web.config

<system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" name="webBinding">
          <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="Transport" />
        </binding>
      </webHttpBinding>
    </bindings>
    <services>
      <service name="TDM.Shared.Services.EmailAlertsService">
        <endpoint address="/Save" binding="webHttpBinding" bindingConfiguration="webBinding" contract="TDM.Shared.Services.IEmailAlertsService">
        </endpoint>
      </service>
    </services>
  </system.serviceModel>
如果我在ajax调用中更改URI,它就会工作,如下所示。 /_vti_bin/TDM.Portal.Services/EmailAlertsService.svc/Alerts/Information

感谢您宝贵的解决方案

在标记下的服务配置中,定义了端点的url。在你的配置中,我看不到地址?是否忘记定义基地址?“/Save”是自定义端点
$.ajax({
                    type: 'POST', //set service type
                    url: "/_vti_bin/TDM.Portal.Services/EmailAlertsService.svc/Save/Alerts/Information", 
                    contentType: "application/x-www-form-urlencoded",
                    data: JSON.stringify(obj),
                    success: function (data) {
                    },
                    error: function (data) {

                    }
                });