Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E57F6D5E4 for ; Tue, 24 Jul 2012 19:19:35 +0000 (UTC) Received: (qmail 43773 invoked by uid 500); 24 Jul 2012 19:19:35 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 43708 invoked by uid 500); 24 Jul 2012 19:19:35 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 43576 invoked by uid 99); 24 Jul 2012 19:19:35 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jul 2012 19:19:35 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 5C019142856 for ; Tue, 24 Jul 2012 19:19:35 +0000 (UTC) Date: Tue, 24 Jul 2012 19:19:35 +0000 (UTC) From: "Jesse MacFadyen (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <783879653.97683.1343157575378.JavaMail.jiratomcat@issues-vm> In-Reply-To: <831923471.32195.1340149842767.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Resolved] (CB-938) Need to pass more complex objects over the bridge MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jesse MacFadyen resolved CB-938. -------------------------------- Resolution: Won't Fix This is a limitation of the Silverlight JSON serialization, adding a 300 kb library dependencies is not a reasonable solution. Working around the specific issue mentioned involves url encoding the FileTransfer params object, it can simply be passed as a string. > Need to pass more complex objects over the bridge > ------------------------------------------------- > > Key: CB-938 > URL: https://issues.apache.org/jira/browse/CB-938 > Project: Apache Cordova > Issue Type: Bug > Components: WP7 > Affects Versions: 1.9.0 > Reporter: Abu Obeida Bakhach > Assignee: Jesse MacFadyen > Labels: json > > [WP7] Passing more complex objects over the bridge... Currently won't work. Basically the DataContractJsonSerializer .NET object that we employ to parse JSON on the native side can't parse nested objects in JSON. The DataContract stuff is supposed to make it easy to cast the various JSON values to .NET types. In the case of a nested object with dynamic keys, that you can't model ahead of time, we tried using a Dictionary type on the native side. This won't work [1]. > This came up when deserializing FileTransfer upload options because they have a nested "params" object that house dynamic &key=value URL parameters to send with the HTTP request. Not sure if it happens in other spots. > Anywho, one potential solution is to explicitly convert nested objects such as these to a dumber structure. In the SO thread [1] they suggest having an array of {key:"known1",value:"foo"} pairs replace the objects. > The native side could parse that. > Another option is to use the JSON.net library [2]. MIT license. 300-ish kb .dll. > The stock System.Json namespace that is available in .NET and has better capabilities is not available on Windows Phone. > Any other solutions/ideas/comments/thoughts? > [1] > http://stackoverflow.com/questions/8064627/deserializing-json-object-with-u > nknown-fields > [2] http://json.codeplex.com/ -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira