How to create JSON to match/serialize to DataContract in WCF Rest Service

后端 未结 3 819
梦谈多话
梦谈多话 2021-01-20 03:34

Interface:

namespace SQRT_WCF
    {
    [DataContract]
    public class PlaceOrder
    {
        [DataMember]
        public string claimID { get; set; }
            


        
3条回答
  •  再見小時候
    2021-01-20 04:23

    I had a similar issue and turned out that I had to define my request format and body. Try this:

    [OperationContract]
    [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json)]
    YourResultType placeOrder(PlaceOrder argPlaceOrderJSON);
    

提交回复
热议问题