Memor.の
2017-04-11 09:25
采纳率: 100%
浏览 12

找不到服务端点

I am getting service end point not found error for below WCF method in Production secondary server, but the same is working in primary server.

[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 Call

$.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) {

                    }
                });

It works if i change the URI in ajax call as below. /_vti_bin/TDM.Portal.Services/EmailAlertsService.svc/Alerts/Information

Appreciate your valuable solutions.

图片转代码服务由CSDN问答提供 功能建议

                    

我在生产辅助服务器中遇到以下WCF方法时找不到服务端点错误,但在主服务器中也是如此。

  [OperationContract]
         [WebInvoke(Method =“ POST”,
                     BodyStyle = WebMessageBodyStyle.Wrapped,
                     RequestFormat = WebMessageFormat.Json,
                     ResponseFormat = WebMessageFormat.Json,
                     UriTemplate =“ / Alerts / Information”)]
         [FaultContract(typeof(Fault))]
         邮件SetEmailAlertInfo(Stream emailAlertInfo);
  

 

web.config

  
     <绑定>
       
         
           
           
         
       
     
     <服务>
       
         <端点地址=“ / Save” binding =“ webHttpBinding” bindingConfiguration =“ webBinding” contract =“ TDM.Shared.Services.IEmailAlertsService”>
         
       
     
   
  

 

AJAX呼叫

  $。ajax({
                     类型:“ POST”,//设置服务类型
                     网址:“ / _ vti_bin / TDM.Portal.Services / EmailAlertsService.svc / Save / Alerts / Information”,
                     contentType:“应用程序/ x-www-form-urlencoded”,
                     数据:JSON.stringify(obj),
                     成功:功能(数据){
                     },
                     错误:函数(数据){

                     }
                 });
  

 

如果我按以下方式更改ajax调用中的URI,它会起作用。 /_vti_bin/TDM.Portal.Services/EmailAlertsService.svc/Alerts/Information

赞赏您的宝贵解决方案。     

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

相关推荐 更多相似问题