json

How to set Json.Net as the default serializer for WCF REST service

Is it possible to override the default WCF DataContractSerializer behaviour when Serialize/DeSerialize entities and use JSON.NET instead? I have the following service contract for handling the City entity. For design reasons the City entity has IsReference=true, and therefore the default DataContractSerializer raise errors. For the "GE...

Looping over a valid JSON and save each value in variable

I'm using jQuery. This is my second post to make my old question more clear. I have made an Ajax request using the jQuery $.ajax function to a PHP script and that PHP script returned this JSON object and when i tested with link text it says it's valid. and i'm treating this JSON response with the success fonction The php script is $...

Jackson not recognizing @JsonCreator annotation

I am currently using Jackson 1.4.2 and attempting deserialization of 'code' values (unique identifiers for type information) that are passed from our UI back to the Java controllers (Servlets). There are multiple types (e.g. ABCType, XYZType, etc.) that all extend from an AbstractType, but each concrete type has a static factory method...

Troubles with JSONP Request

Ok, I'm not 100% sure what I'm doing wrong here. Maybe I just need a second pair of eyes to reveal the error of my ways. I'm sending a JSONP request using jQuery from one domain (https://customerhub.net) to a PHP script on my domain (https://dankennedy.com) and getting a response from that script. I know the request is working because...

reload extjs object after ajax

I am using a star rating plugin with ExtJS that is working well, but I need to reset the displayValue after the click event. I also have a json object with {'rating':'#'} but I cannot figure out how to have ExtJS correlate this value with the Rater's displayValue property. It seems that I set it after the component is already rendered, b...

Error in JSON or writing dictionary

I'm gettin the followig error after converting JSON echo into a dictionary, * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[NSMutableArray insertObject:atIndex:]: attempt to insert nil object at 0' ** Call stack at first throw: Here is my JSON deserialization code, I've used this model before for ...

Spring MVC AJAX and JSON using Custom View Resolver, and Custom View

custom view: public class MyView extends AbstractView { .... awesome stuff ... } controller: @RequestMapping(value="mylocation") public ModelAndView dosomething() { ... modelAndView.setView( new MyView() ); return modelAndView; } For some reason this doesn't work... The only view resolver I have is the following: <bean cl...

Colon in JSON string

Can I escape a colon : that is inside a JSON string? Currently this object/value set { pn: "MT46H128M16LFCK-5 IT:A", visible: false, url: "/$ws$/29/1/products/ProductDetails.html?product=products/dram/MT46H128M16LFCK-5 IT" } doesn't get read. I suspect it's due to the :A in the pn value. How do I escape it or otherwise grab it...

Why do I get this 501 Not Implemented error?

I am performing the following AJAX call: $(document).ready(function() { $.getJSON('https://sendgrid.com/api/user.stats.json', { 'api_user': '[email protected]', 'api_key': 'MYAPIKEY', 'user': '[email protected]', 'category': 'MY_CATEGORY' }, function(response){ alert('received response'); } ...

How to handle REST Exceptions?

Hi All, We are in the middle of a ongoing discussion about how to handle REST exceptions. Response Content type : JSON Two solutions we have: 1) Throw all the unchecked exceptions as a JSON response. 2) Send Request Invalid Response code. Arguments: When its a error, why return JSON? Just send a invalid response code. Counter Argu...

.getJSON() returns null

I'm using jQuery to get and parse JSON using example flickr service : http://api.jquery.com/jQuery.getJSON/ everything works fine if i use flickr url , the problem starts when i try to get my own service. It works when I save the output and read it from file but i doesn't work from the server url. Firebug shows two that the object is n...

Service android json or soap?

Hi! iam about to call a service from my server. Should I use Json or Soap? My service is in asp.net Are there not any packages in android that has to do with the service connections? ...

Diffing a JSON document

Well, my question is a little complicated, but here goes: I have a Python server that stores client (written in JavaScript) sessions, and has complete knowledge of what the client currently has stored in its state. The server will constantly fetch data from the database and check for any changes against the client state. The data is JS...

send ajax form to web service, only after successful validation

my target is to create form that validated in the client side, and only when it is valid, send ajax call to asmx web service. i manage to do that two separately: client-side validation and ajax send to web service, and i want to combine this two. how?.. i have this form (i simplify everything for simple example): <form id="ContactForm"...

how can I dig my variable out of this pit?

I asked a fairly poor question yesterday, but I still have the same general problem. I wanted to add a variable property to an object, and the solution I attempted was to do an ajax request to receive the variable, and then set the property to the response. I think I have tried this at least 100 different ways: Ext.onReady(go); functi...

JSON format in PHP

{"required_items":[ { "filename":"abcd", "no":"3" }, { "filename":"abc", "no":"2" } ]} I am not getting the code of the JSON format in PHP - I want to insert the f...

Is this valid JSON markup?

Hello. I am attempting to get some information from a russian shipping website. Being a n00b to JSON/Jquery/Internets I am stuck getting the data into json format. Following the company's API, I go to the URL: http://emspost.ru/api/rest/?callback=json&amp;method=ems.calculate&amp;from=city--abakan&amp;to=city--anadyr&amp;weight=1 Thi...

How to totally control json serialization in WCF

I need to totally control the json serialization process in my Rest WCF service. I need to substitute the serialization result, that is something similar to: { foo: 42, bar: 43 } with: myFunc( { foo: 42, bar: 43 } ); any ideas? thanks m. ...

Tweaking Hash#to_json

Hi guys, I've been struggling with this one the whole day. In my Rails 2.3.5 app, I had a bunch of custom code which allowed the following to happen: >> strip_hash_keys_for_json({ "a" => 1 }).to_json => "{ a: 1 }" So you see that string keys don't get quoted. It was implemented by creating a String descendant class that returned self...

Loading JSON into table, sometimes table loads w/o data

So, I have an application where I have a blank table in the DOM and I load JSON table into the table dynamically with jQuery's .getJSON function. This works...most of the time. Sometimes my table appears on the page without any data, although firebug says my table and the JSON where loaded. Anyone have any ideas why this may happen? ...