【发布时间】:2016-11-04 16:42:10
【问题描述】:
我有一个 Json WCF 服务我的方法请求输出参数我如何从客户端传递输出参数
[ServiceContract]
public interface ITestServices
{
[OperationContract]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped, Method = "POST", UriTemplate = "GetPerson", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
Person GetPerson(out ResponseStatus ResponseStatus, int PersonID);
}
【问题讨论】:
-
我修复了这个问题尝试 {$.ajax({type: "POST",url:localhost:55566/TestServices.svc/GetPerson", data: { "ResponseStatus": null ,"PersonID": "789797" }, contentType:"application/json; charset=utf-8", dataType: "json",success:function (data){$("#divItems").html(JSON.stringify(data));}, error: function (错误) {$("#divItems").html(error.responseText);}});} 捕获 (e) {$("#divItems").html(e.message);}
标签: c# json wcf parameters out