ajax - Post Data to Object Type Data Member in WCF using C# -
below code (required dtos)
[knowntype(typeof(locatereceive))] [datacontract] public class commandreceiver : messagecommand { [datamember] public string commandkey { get; set; } [datamember] public string mac { get; set; } [datamember] public object response { get; set; } // need here, should hold object reference of known types } [datacontract] public class messagecommand { [datamember] public int64 messagecommandid { get; set; } } [datacontract] public class locatereceive { [datamember] public string latitude { get; set; } [datamember] public string longitude { get; set; } }
now want response data member can hold object of locatereceive when pushed via ajax (i using fiddler same).
below request body sent fiddler:
{ "messagecommandid":9223372036854775807, "commandkey":"string content", "mac":"string content", "response":{ "latitude":"string content", "longitude":"string content" }}
getting error: bad request
ultimately want response data member can hold/convert n number of class object passed in ajax.
Comments
Post a Comment