【问题标题】:ajax enabled wcf service can use get only, can't use post启用 ajax 的 wcf 服务只能使用 get,不能使用 post
【发布时间】:2009-06-27 04:00:58
【问题描述】:

我有启用 ajax 的 wcf 服务,我只能用 get 调用而不是 post,虽然我可以用 get 工作,但有什么理由吗?是否需要启用 webmethod 或其他什么?

这是我的 wcf 服务的外观

    [OperationContract]
    [WebGet]
    public System.Collections.Generic.IEnumerable<ListingDisplay> Find(string postalCode)

我在尝试使用 jquery ajax 时添加了 [WebGet],它在 asp.net scriptmanager 中不需要。

【问题讨论】:

    标签: wcf


    【解决方案1】:

    查看[WebInvoke()] 属性 - 它应该允许您在方法中指定 POST、PUT、DELETE HTTP 动词。

    马克

    【讨论】:

      猜你喜欢
      • 2020-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-22
      • 1970-01-01
      • 2012-03-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多