0
我想JSON對象傳遞給WCF服務, 這是我服務的方法:通JSON對象WCF服務越來越空消息
[OperationContract]
[WebInvoke(Method = "POST",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped)]
string InsertUserDetails(UserDetails userInfo);
public string InsertUserDetails(UserDetails userInfo)
{
return "welcome";
}
從jquery的呼喚:
$.ajax({
type: 'POST',
url: url,
contentType: "application/json",
data: JSON.stringify({ userInfo: data }),
dataType: "json",
success: function (result) {
alert(result);
}
});
我在這裏在警報中收到NULL消息