契约定义:
[OperationContract]
[WebInvoke(UriTemplate = "Gn/Order/test",Method = "Post",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
string Test(TestRequest2 req);
实体定义:
[DataContract]
public class TestRequest2
{
[DataMember]
public string msg { get; set; }
}
这是请求的监视的对象!
请参考这个解决:http://hayageek.com/cross-domain-ajax-request-jquery/