我一直在成功地将 json 发送到我的 wcf,但是当我发送一个非常复杂的带有多个转义的 json 数组时,服务会忽略它。当我尝试调试它时,我可以看到 json 没有通过 webmethod 调用,因为该值为 null。它抱怨无法识别的转义序列。我尝试在 java/android 中使用
String.Replace("\\", "\\\\");
但这似乎对我不起作用。
有没有办法让 wcf 忽略 json 中的转义?除了 microsoft webservices 和 wcf 之外,我从来没有遇到过这个问题,这让我很头疼。
["{\"CRASH_CONFIGURATION\":{\"hardKeyboardHidden\":\"HARDKEYBOARDHIDDEN_YES\",\"orientation\":\"ORIENTATION_PORTRAIT\",\"keyboard\":\"KEYBOARD_NOKEYS\",\"screenLayout\ ":\"SCREENLAYOUT_SIZE_NORMAL+SCREENLAYOUT_LONG_NO\",\"mcc\":310,\"textLayoutDirection\":0,\"locale\":\"en_US\",\"compatScreenHeightDp\":455,\"compatSmallestScreenWidthDp\ ":320,\"fontScale\":\"1.0\",\"navigationHidden\":\"NAVIGATIONHIDDEN_YES\",\"screenWidthDp\":320,\"fontTypeIndex\":\"-1\",\ "screenHeightDp\":455,\"uiMode\":\"UI_MODE_TYPE_NORMAL+UI_MODE_NIGHT_NO\",\"userSetLocale\":false,\"navigation\":\"NAVIGATION_NONAV\",\"smallestScreenWidthDp\":320,\"keyboardHidden\":\"KEYBOARDHIDDEN_NO\",\"seq\":4,\"mnc\":410,\"compatScreenWidthDp\":320,\"触摸屏\":\"TOUCHSCREEN_FINGER\"},\"USER_CRASH_DATE\":\"2013-11-04T19:58:14.000-08:00\",\"EVENTSLOG\":\"11-04 19:55: 07.501 I\\/notification_enqueue(373):
<bindings>
<basicHttpBinding>
<binding name="SoapEndpointBinding"
closeTimeout="00:10:00"
maxBufferPoolSize="250000000"
maxReceivedMessageSize="250000000"
openTimeout="00:10:00"
receiveTimeout="00:10:00"
sendTimeout="00:10:00">
<readerQuotas maxDepth="4500000" maxStringContentLength="4500000" maxBytesPerRead="40960000" maxNameTableCharCount="250000000" maxArrayLength="4500000"/>
<security mode="None"/>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="RestEndpointBinding"
closeTimeout="00:10:00"
maxBufferPoolSize="250000000"
maxReceivedMessageSize="250000000"
openTimeout="00:10:00"
receiveTimeout="00:10:00"
sendTimeout="00:10:00">
<readerQuotas maxDepth="4500000" maxStringContentLength="4500000" maxBytesPerRead="40960000" maxNameTableCharCount="250000000" maxArrayLength="4500000"/>
<security mode="None"/>
</binding>
</webHttpBinding>
</bindings>