开发者

Pass to WCF string and parse it with JSON Newton

开发者 https://www.devze.com 2023-03-03 19:59 出处:网络
I have var sendThisString = JSON.stringify({ \'value\': jsObj }); and I have WCF [OperationContract] [WebInvoke(Method = \"POST\",

I have

var sendThisString = JSON.stringify({ 'value': jsObj });

and I have WCF

[OperationContract]
[WebInvoke(Method = "POST",
           BodyStyle = WebMessageBodyStyle.Wrapped,
           RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json)]
 public string RowString(string rawJSON)
 {
        return "";
 }

So I did not want to use standard WCF serialisation my json string to C# object

I need to pass json string to WCF and then I will p开发者_如何学Carse it by my serialisation

I just want to see sample (client and server side) where you pass to WCF string "{'test':'test1'}" or another


I decide replace jsObj with string, or do not use wcf


If you want to use WCF to receive raw JSON (or any RAW data, for that matter), you can use the raw programming model - take a Stream as the input parameter. More information at http://blogs.msdn.com/b/carlosfigueira/archive/2008/04/17/wcf-raw-programming-model-receiving-arbitrary-data.aspx.

0

精彩评论

暂无评论...
验证码 换一张
取 消