json

How to deserialize JSON string

I have found lots of online tutorials but all of them are deserializing JSON strings into objects or lists of objects. I just have a web service which returns either 1 or 0 as JSON. So it prints something like: ""\"0\"" Or: ""\"1\"" How can I deserialize a simple JSON like that into a string? ...

Using DataContractJsonSerializer

I am trying to host a WCF service that responds to incoming requests by providing a json output stream. I have the following type [DataContract] [KnownType(typeof(List<HubCommon>))] [KnownType(typeof(Music))] [KnownType(typeof(AppsAndPlugins))] [KnownType(typeof(Notifications))] [KnownType(typeof(Scenes))] [KnownType(typeof(Skins))] ...

Ok, I've got the bit.ly link, but now the asynchronicity of jQuery is getting in the way.

function dlLink(title, currentArray, currentIndex, currentOpts) { var img = new Image(); img.src = 'Gallery/Wallpapers/' + title; html = img.width + ' x ' + img.height + '<br />' + '<a class = "nav" href = "Gallery/Wallpapers/' + title + '" target = "_blank">Download</a><br />http://'; ...

how do i install json in xampp server?

How do I install json in xampp server? ...

How to Consume JSON as input in PUT and POST method of REST webservice in java

Hello All. I am trying to create a REST web service using JAX-RS. In that, I have PUT method or POST method which consumes the json as mediatype in the REST web service. Can I know how to call these methods from the client side. How do we pass that json as input from client side to those PUT and POST method and how would we consume the...

Convert the XML to JSON format

Hi, everyone, I want to convert the XML file to the JSON format, but I don't know how to convert it into JSON format. Can anyone help me? Thank you. <class> <num>2</num> <student> <name>[email protected]</name> <age>5</age> </student> <student> <name>[email protected]</name> <age>10</ag...

JQUERY getJSON / ajax response not being processed

I am sending a json request to a server as below: $.getJSON("prod_search.php?type=getCustInfo&custID="+custID, function(json) { alert(json.address); $("#invAddress").html(json.address); $("#currency").html(json.second); }); Using firebug to check, the response is below, but the alert shows 'undefined' and no values are inserted....

Call a JSON file in the server in JSP

Hi, everyone, I want to ask some questions about the JSP and JSON file. I have a JSON format file which put in the tomcat server. And I use the JSP to write the web application. When the user types the URL and open the JSP page, the JSP page will get the file in the tomcat server (e.g. it can assume the file in the "c://location"). Aft...

Differences in JSON.stringify result between browsers

Hey! When I JSON.stringify() the following code: var exampleObject = { "name" : "Žiga Kovač", "kraj" : "Žužemberk"}; I get different results between browsers. IE8 and Google Chrome return: {"name":"\u017diga Kova\u010d","kraj":"\u017du\u017eemberk"} While Firefox and Opera return: {"name":"Žiga Kovač","kraj":"Žužemberk"} I am ...

Help trying to generate tricky multidimensional array format

Hi guys, I'm having trouble trying to build an array in PHP which will output in the JSON format I am looking for. I will show you what I am trying to achieve and where I have got to so far: [ {"data":[{"x":3,"y":0},{"x":10,"y":0}]}, {"data":[{"x":11,"y":0},{"x":13,"y":0}]}, {"data":[{"x":12,"y":1},{"x":17,"y":1}]} ] I am ...

How to retrieve the file in JSON format in JSP?

Hi, everyone, I want to ask a question about the JSON and JSP. I have 2 JSP (JSP1 & JSP2) pages and 1 JSON format file. Both of the JSP pages are pack into a .war file. The JSON file is stored in a web server(e.g. http://examp;e.com). And I have to do the following tasks: 1) Open the JSP1 (has a link) 2) When the user clicks the lin...

why does HTTPClient response produce JSON stream, when the same GET request in the browser shows XML response?

Hi, I am using HttpClient for the first time to make a request to a web service (defined by WADL), I'd like to unmarshall the response into a meaningful object, in the browser if I perform the Get request it response with XML. But when I display the response from the code it seems to be JSON. Am I missing a step? or is there a way th...

get data from dynamic key value in json

The requirement is following: I have to get the location field from page. var input= global.input = document.getElementById("Location"); Get the neighborhood area from the json file based on input and show on the page. I have a json object and have to filter the data from the json object based on the key value (location) var inputLo...

trying to replace "\" char using javascript for a json parser

so I have the following line of javascript: YAHOO.lang.JSON.parse(txt) where text is a string that is pulled from the database. This is an example of one of the problem strings I'm getting back: 5000\25\30% The JSON parser is throwing syntax errors on the / character as far as I can tell. I looked through threads here and most of t...

How to write an index loop for a json object

I have an image updater. I am loading by JSON the exact same file/partial that show my images. I would like to write a loop that runs through an index and replaces every image with its equal. This is the first div in my json object : [{ "photo": { "position":1, "photo_file_size":45465, "created_at":"2010-10-05T09:51:13-0...

.NET Json Serialization, JSON_MaxJsonLengthExceeded when passing 2 Megabytes of data.

What sets the JSON buffer length other than web.config or creating an instance of the JavaScriptSerializer? Is anyone aware if ASP.Net, the .Net Framework, IIS, IE force or impose a buffer lenght forced at 2 Megabytes or data? So far maxJsonLength is the only property I control. All works as expected bellow 2Megabytes, but above that...

Parsing json as3

Hi, I have been trying and searching with no success.I waned to parse the following json string : {"label":"My ncWMS server","children":[{"label":"champ","children": [{"id":"champ/XE","label":"sea_surface_height_above_geoid"},{"id":"champ/U","label":"barotropic_eastward_sea_water_velocity"},{"id":"champ/V","label":"barotropic_northward...

chrome extension to pass current tab url to remote json search then parse results into an html table.

I am trying to make a chrome extension that allows to me to take the url of the current tab and pass that to a 3rd party website search. This php returns JSON formatted text. I would then like to format this JSON as a simple html table. pseudo code: function getUrl(){ currentUrl = the current tab url } function search(currentUrl...

Response time Issue in WCF REST Service returning a large file

HI, I have created a WCF REST service with response format as JSON. The basic functionality of the service is that when it is called it will return a large file(mostly zip file) from the file system to the requester. The time taken for the file to completely downloaded by the user is taking more than 20 mins for 20MB file. How to find ...

What is the correct format in JSON?

Hi, everyone, I have a question about the JSON. I am writing a JSON file, but I am not sure which of the following formats are correct. Can anyone help me? { "class": { "number": 2, "student": { "name": "Tom", "age": 1 }, "student": { "name": "May", "...