json

Finding object in nested NSDictionary when the parent key is unknown?

*I'm using yajl_JSON library to produce an NSDictionary from a JSON response for the bit.ly url shortening service.* The JSON response: { errorCode = 0; errorMessage = ""; results = { "http://www.example.com/" = { hash = 4H5keM; shortKeywordUrl = ""; shortUrl = "http://bit.ly/4BN4qV"; ...

How to securely communicate with server?

I'm building a solution consisting of an app and a server. Server provides some methods (json) and the app uses them. My aim is to make those API methods inaccessible to other clients. What is the best way to do so? Should I take a look at certificates (to sign every outgoing request)? If yes, where do I start and what is the performance...

dojo newbie read json response from web service

i have a webservice that is returning this response : <string xmlns="http://tempuri.org/"&gt;{ "H...[ { "ID":"1","Name":"Test"} ]}</string> when i try to get the response back, i keep getting the error : "missing ; before statement" i am just starting to get into this so am probably doing something very wrong. why is the response n...

dojo newbie read json response from web service

i have a webservice that is returning this response : <string xmlns="http://tempuri.org/"&gt;{ "Head":[ { "ID":"1","Name":"David"} ]}</string> when i try to get the response back, i keep getting the error : "missing ; before statement" i am just starting to get into this so am probably doing something very wrong. why is the respons...

problem with json-web-service call within jqModal

I have a page that loads another page via ajax and jqModal. In that other page, there is a button that calls a web service using json. This button doesn't work. What could be the problem? What other solution do you propose to achieve this? ...

IE8 Json problem

I'm facing very strange issue, I'm getting JSON object from django powered site and excuting it using eval(). It works on all the other browsers except all versions of IE. in IE, I am getting "variable_name" is null or not an object. I've tried everything I could but so far no luck. here is my json object var results = {"result":[ { ...

Symfony Method to Turn Template to String

I use the Symfony PHP MVC framework. I'm using JSON to pass an AJAX response, and I need an action's template HTML to be one of the values passed. Does Symfony have a method along the lines of renderTemplateToString() ? Even for those unfamiliar with Symfony, is there an obvious way to do this? ...

Updating Google's Contacts API with JSON

With the Google Contacts API, you can GET contact information using JSON, but is there a way to update it using JSON? I haven't had any success in my attempts, and continue to get a "content not allowed in prolog" error when I try (seemingly indicating that they're expecting XML in the PUT request). On the GET request, I GET from follo...

Decode JSON data in Java

Hi, I'm used to PHP, and decoding json data is just a line of code. What would be the easiest way to do this in java? ...

Ruby on Rails to_json problem with :include

Hi, I have the following code @asset = Asset.first(:include => [:asset_statuses => [:asset_status_name, {:asset_location => [{:asset_floor => :asset_building}]}],:asset_type => [:asset_category => :asset_department]], (probably not the best DB table desing but that's what I have to use...) So, the Asset.first works correctly and it ...

create json string on client side

Hi, I am trying to create the JSON string / object that is equivalent to the following data on the server side. can somebody help? Public Shared Function GetData() As List(Of Employee) Dim list As New List(Of Employee)() Dim newEmployee As New Employee() newEmployee.EmployeeID = "1" newEmployee.FirstName = "Sridhar" ...

Encoding issue: Cocoa Error 261?

So I'm fetching a JSON string from a php script in my iPhone app using: NSURL *baseURL = [NSURL URLWithString:@"test.php"]; NSError *encodeError = [[NSError alloc] init]; NSString *jsonString = [NSString stringWithContentsOfURL:baseURL encoding:NSUTF8StringEncoding error:&encodeError]; NSLog(@"Error: %@", [encodeError localizedDescripti...

How to parse somewhat wrong JSON with Python?

I have a following JSON string coming from external input source: {value: "82363549923gnyh49c9djl239pjm01223", id: 17893} This is wrong-formatted JSON string ("id" and "value" must be in quotes), but I need to parse it anyway. I have tried simplejson and json-py and seems they could not be set up to parse such strings. I am running P...

Getting and setting form values client side with javascript, json and jquery

I am building out an ajax enabled UI using webforms in asp.net. I really want this interaction to be extremely light. What I would like to do is make a call to get the data and then bind it to my form client side. Here is my working example. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD...

how to convert Doctrine object into json

I am using Doctrine 1.2, how could I get the query object into json / array format? $user = Doctrine_Query::create() ->select('u.id, u.username, u.firstname, u.lastname') ->from('User u') ->orderby('u.id') ->execute(); ...

routes.rb explicitly choose template

I would like to create one .erb file to be the output for a number of tiny actions that are just returning JSON. So with routes similar to: map.json 'contacts_json', :controller => 'contacts', :action => 'get_json' map.json 'cal_json', :controller => 'calendar', :action => 'get_json' ... but this requires I create a contacts erb, and...

How to handle large file uploads via WCF?

I am looking into using WCF for a project which would require the ability for people to upload large files (64MB-1GB) to my server. How would I handle this with WCF, possibly with the ability to resume uploads. In order to handle a larger client base, I wanted to test out JSON via WCF. How would this affect the file upload? Can it be d...

Best way to escape javascript string? (json?)

Using C# .net I am parsing some data with some partial html/javascript inside it (i dont know who made that decision) and i need to pull a link. The link looks like this http:\/\/fc0.site.net\/fs50\/i\/2009\/name.jpg It came from this which i assume is javascript and looks like json "name":{"id":"589","src":"http:\/\/fc0.site.net\/fs...

JSON use in Javascript

I have been mis-interpreted. I have created a JSON Object in PHP. I just need access to that object in Javascript. thats all. i just learned that many of my problems can be solved by using JSON. now how to use JSON is another problem, though ;-) suppose this is the code in PHP: $row = array() while ($row = mysql_fetch_object($result) ...

jquery copy json object

I'm iterating through a set of json data which carries results of a few database tables. Amongst other data I have a RateTable ...erm... table, and a Resources table. The RateTable has a property name ResourceId which links to the Resources record. So, I'm iterating through my RateTable and I need to reference my Resource record and us...