Read JSON Date produced by ASP WCF WebService

Hello,
I am pulling down some data from a JSON Webservice and the
format that it gives dats in is as follows:
/Date(1234296241740-0800)/
This post describes the JSON Date format in further detail -
it appears to be an accepted standard
http://weblogs.asp.net/bleroy/archive/2008/01/18/dates-and-json.aspx
But I can't find a decoder in action script I have tried the
following
JSON.decode(o)
from as3corelib:
DateUtil.parseW3CDTF(o)
DateUtil.parseRFC822(o)
Does Anyone know how to decode this format into a date
object?
Thankyou

I wrote a little script to handle this perhaps it will help
others

Similar Messages

  • Reading JSON data from a URL

    Hi all,
    I have a requirement of reading JSON data from a particular URL and using one of the value to set one property in iView. I need some info on how to get JSON data from a URL and extracting attribute's value from it.
    What are the APIs that can be used for this?Can anyone provide a solution/working example in Java for this?
    I am working on EP 7.3.

    Hi Tarun,
    JAXB should work for you. Take a look at this example:
    JAXB JSON Example | Examples Java Code Geeks
    Regards,
    Tobias

  • What's the best way to read JSON data?

    Hi all;
    What is the best way to read in JSON data? And is the best way to use it once read in to turn it into XML and apply XPath?
    thanks - dave

    jtahlborn wrote:
    without having a better understanding of what your definition of "use it" is, this question is essentially unanswerable. Jackson is a fairly popular library for translating json to/from java objects. the json website provides a very basic library for parsing to/from xml. which one is the "best" depends on what you want to do with it.Good point. We have a reporting product ([www.windward.net|http://www.windward.net]) and we've had a number of people ask us for JSON support. But how complex the data is and what they want to pull is all over the place. The one thing that's commin is they generally want to pull down the JSON data, and then put specific items from that in the report.
    XML/XPath struck me as a good way to do this for a couple of reasons. First it seems to map well to the JSON data layout. Second it provides a known query language. Third, we have a really good XPath wizard and we could then use it for JSON also.
    ??? - thanks - dave

  • How to access json data posted to a CF webservice

    Hi All,
    I have a ExtJS app that makes a call to a Coldfusion webservice and sends a json object as part of the POST request. In Firebug I can see the json object being posted but I can't seem to access it in Coldfusion.
    Anyone know how or if this is possible?
    Thanks,
    Orla

    Thanks...
    The following is exactly what I need as I want to keep the json to pass on to a java webservice call:
    <cfset requestJson = toString(getHttpRequestData().content)>

  • Populating JSON Data to Combobox - Need Help!

    Hello,
    I am trying to use a dynamicly created JSON comming from a webservice to populate comboboxes. I am really new to Flex and ActionScript 3.0.
    The problem what i have here is that my combobox stays empty. I am trying to fill it with all values from "key" (representing the manufacturers)
    Here´s my Code so far:
    [CODE]<?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute"
                    creationComplete="service.send(params)" xmlns:s="library://ns.adobe.com/flex/spark">
        <mx:Script>
            <![CDATA[
                import com.adobe.serialization.json.JSON;
                import mx.collections.ArrayCollection;
                import mx.rpc.events.ResultEvent;
                public var myURL:String = "http://dev.ws.topdata.de/data/tdifdata.php?";
                public var params:Object = {Lookup: "DeviceManufacturerId"};
                private function onJSONLoad(event:ResultEvent):void
                    //get the raw JSON data and cast to String
                    var rawData:String = String(event.result);
                    //decode the data to ActionScript using the JSON API
                    //in this case, the JSON data is a serialize Array of Objects.
                    var arr:Array = (JSON.decode(rawData) as Array);
                    //create a new ArrayCollection passing the de-serialized Array
                    //ArrayCollections work better as DataProviders, as they can
                    //be watched for changes.
                    var dp:ArrayCollection = new ArrayCollection(arr);
                    //pass the ArrayCollection to the Combobox as its dataProvider.
                    dropdown.dataProvider = dp;
                    trace(rawData);
            ]]>
        </mx:Script>
        <mx:HTTPService id="service" method="GET" resultFormat="text" url="{myURL}" result="onJSONLoad(event)">
        </mx:HTTPService>
        <s:ComboBox x="26" y="33" labelField="key" id="dropdown"/>   
    </mx:Application>[/CODE]
    trace(rawData); returns something like
    [CODE]"1607":
                "key": "Xitan",
                "value": "2283",
                "isPremium": "0"
        "1608":
                "key": "Xitron",
                "value": "2284",
                "isPremium": "0"
        "1609": [/CODE]
    Now i´ve tried to bind this dataProvider for my first combobox listing all items with the value from "key" but my combobox stays blank/empty....

    I tried the following now and it says "can´t convert obect@... to Array"  maybe there is something wrong with the JSON outout from the  webservice? But the JSON from the webservice validates, however if i test it with a small own JSON file locally it works...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    layout="absolute"
                    minWidth="955" minHeight="600"
                    applicationComplete="init()"
                    frameRate="30">
        <mx:Script>
            <![CDATA[
                import com.adobe.serialization.json.JSON;
                // var ini
                private var filePath:String = "http://dev.ws.topdata.de/data/tdifdata.php?Lookup=DeviceManufacturerId";
                private var urlLoader:URLLoader;
                private var jsonDataArray:Array;
                private function init():void
                    // Add event listener for button click
                    btn.addEventListener(MouseEvent.CLICK,loadJSONFile);
                private function loadJSONFile(e:MouseEvent=null):void
                    // Load file
                    urlLoader = new URLLoader();
                    urlLoader.addEventListener(Event.COMPLETE, fileLoaded,false,0,true);
                    //urlLoader.addEventListener(IOErrorEvent.IO_ERROR, fileLoadFailed);
                    urlLoader.load(new URLRequest(filePath));
                private function fileLoaded(e:Event):void
                    // Clean up file load event listeners
                    urlLoader.removeEventListener(Event.COMPLETE, fileLoaded);
                    // If you wanted to get the data from the event use the line below
                    //var urlLoader:URLLoader = URLLoader(event.target);
                    // Parse the file to an array
                    jsonDataArray = JSON.decode(urlLoader.data);
                    trace(jsonDataArray);
                    // Proceed to do something with the loaded data
                    proceed();
                private function proceed():void
                    // Retrieve data tests
                    trace("jsonDataArray[0].name = " + jsonDataArray[0].name);
                    // Populate data grid with our JSON Data
                    dg.dataProvider = jsonDataArray;               
            ]]>
        </mx:Script>
        <mx:DataGrid horizontalCenter="0" top="100" id="dg" width="400" height="200">
            <mx:columns>
                <mx:DataGridColumn headerText="Key" dataField="key"/>
                <mx:DataGridColumn headerText="Value" dataField="value"/>
            </mx:columns>
        </mx:DataGrid>
        <mx:Label text="An example of parsing JSON using AS3Corelib" color="#FFFFFF" fontWeight="bold" left="10" top="10" fontSize="14"/>
        <mx:Button label="PARSE DATA INTO DATA GRID" horizontalCenter="0" top="70" width="400" id="btn"/>
    </mx:Application>

  • Reading the data from web

    Hi guys ,
    I am new to j2me ,i am going to start a project named onlineNews
    for this project i need to read the data from web.can anyone help me with a sample code for reading a data from web
    thank u for spending your precious time

    that depends on the used technology on top of the web. I believe with J2ME you have access to the URLConnection class, so you can send HTTP requests manually. Otherwise you will need to use low level sockets, or use webservices such as SOAP or XML-RPC.
    There is a lightweight XML-RPC client available for J2ME. It is no longer in development, but that doesn't mean that it doesn't work.
    http://kxmlrpc.objectweb.org/

  • DeserializeJSON - is there a limit on the size of the JSON data that can be converted?

    I have some valid JSON data that's being converted successfully by DeserializeJSON... until it gets to a certain size, or that's certainly what appears to be happening.  The breaking point seems to be somewhere in the neighborhood of 35,000 characters... about 35KB.  When the conversion fails, it fails with a "JSON parsing failure: Unexpected end of JSON string" message.  And when the conversion fails, the JSON data is deemed to be valid per tools like this one:  http://www.freeformatter.com/json-validator.html.
    So, is there a limit on the size of the JSON data that can be converted by DeserializeJSON?
    Thanks!

    Thanks Carl.
    The JSON is being submitted in its entirety, confirmed by Fiddler.  And it's actually being successfully saved to a SQL Server nvarchar(MAX) field too.  I can validate that saved JSON.
    I'm actually grabbing the JSON to convert directly from the SQL Server, and your comments / thoughts led me down the path of resolution.
    Turns out that the JSON was being truncated prior to getting to the DeserializeJSON command, but it was the cfquery pull that was doing the truncating.  The fix was to enable "long text retrieval (CLOB)" for this datasource in CF Admin.  I'd never run into that before or even knew that this setting existed.
    Thanks again for your comments!

  • Read Write Data into a MS Word document

    The requirement I am fullfilling directly specifies the need to write data into a Microsoft Word Document and if Necessary, Read Back data from a Microsoft Word Document. The data will be simple text but as time goes on I anticipate the systems engineers may expand the requirement. I want to cross one bridge at a time so I am just concentrating on the text issue. I must do it from within a stand-alone application. Not through a server, not through ASP, not through a browser, just a stand alone application. It appears from my own investigation of the JAVA API that this is not possible. Regrettably, I am only a day or so away from switching to C# or VB to get this job done. My first question is
    1. Can Java Do this?
    2. If not, does Sun Microsystems have any plans to add this capabiliy?
    3. Can we make recommendations to Sun to add this capability to JAVA?

    1. Can Java Do this?Java can do anything but there is no built-in ability to do just that.
    2. If not, does Sun Microsystems have any plans to add
    this capabiliy?
    3. Can we make recommendations to Sun to add this
    capability to JAVA?Very doubtful! MS Office document formats are not completely open to the public - and they are weird! Supporting this capability would probably require an agreement with Microsoft and it would mean you had to change the API for every time Microsoft chooses to change the document formats.
    But there are some open source tools that claim to be rather good at reading and writing MS Office files. Take a look at this one:
    http://jakarta.apache.org/poi/index.html

  • Simple Examples of data connectivity and transfer of data from an .asp.vb to javascript in an .aspx file

    What forum might be useful in solving this issue:
    Simple Examples of data connectivity and transfer of data from an .asp.vb to javascript in an .aspx file

    They'll help you here in the Microsoft ASP.net forums.
    http://forums.asp.net/
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • My SWF is not reading a data file when off my machine

    I have done a build out of Flash Builder 4.5.
    My app reads an external XML in the local dir and displays a pie chart and then a bar chart for each of the selected pie wedges.
    Works great for me.
    But when I share the SWF and XML with co workers the SWF does not seem to read the XML for them.
    Is there another file I need to provide them?
    Or is there a build setting I have not set?

    Thank you.
    I tried this and it seems to work.
    But a total standalone app is not what I am looking for.
    I am producing this for researchers that would then want to add these visualizations
      to their presentations and reports.
    So the product needs to be able to be embeded into Word docs, Power Point and the like.
    My goal is to produce an SWF that reads an external XML file for data to
      then visualize on charts.
    I have found that if I embed the data in the original mxml file it seems to work fine.
    I only am having trouble when I start trying to read external data.
    I guess I will resort to hard wiring the data into the SWF but it seems to not be right.

  • Save the data in the file as json data

    Hello,
    I need to read data from list / Pictures gallery / Documents  and save the returned data  in the file as json data .
    How Can I Implement that .
    ASk

    Try below:
    http://msdn.microsoft.com/en-us/library/office/jj164022%28v=office.15%29.aspx
    The code in the following example shows you how to request a JSON representation of all of the lists in a site by using C#. It assumes that you have an OAuth access token that you are storing in the
    accessToken variable.
    C#
    HttpWebRequest endpointRequest = (HttpWebRequest)HttpWebRequest.Create(sharepointUrl.ToString() + "/_api/web/lists");
    endpointRequest.Method = "GET";
    endpointRequest.Accept = "application/json;odata=verbose";
    endpointRequest.Headers.Add("Authorization", "Bearer " + accessToken);
    HttpWebResponse endpointResponse = (HttpWebResponse)endpointRequest.GetResponse();
    Getting properties that aren't returned with the resource
    Many property values are returned when you retrieve a resource, but for some properties, you have to send a
    GET request directly to the property endpoint. This is typical of properties that represent SharePoint entities.
    The following example shows how to get a property by appending the property name to the resource endpoint. The example gets the value of the
    Author property from a File resource.
      http://<site url>/_api/web/getfilebyserverrelativeurl('/<folder name>/<file name>')/author
    To get the results in JSON format, include an Accept header set to
    "application/json;odata=verbose".
    If this helped you resolve your issue, please mark it Answered

  • Modify JSON data after Approval

    I've managed to write my own UI5 app based on the "Building SAP Fiori-like UIs with SAPUI5", and I want the Approve function to work now.
    I have the following JSON data detail:
      "BusinessPartnerList": [
      "BPId": "0100000000",
      "Role": "01",
      "EmailAddress": "[email protected]",
      "PhoneNumber": "6789",
      "WebAddress": "http://www.sap.com",
      "CompanyName": "SAP",
      "LegalForm": "AG",
      "Country": "DE",
      "City": "Walldorf",
      "PostalCode": "69190",
      "Street": "Dietmar-Hopp-Allee",
      "Building": "15",
      "SalesOrders" : [
      "SalesOrderID": "0500000009",
      "Netto Amount": "3338.00",
      "Time Stamp": "2014.04.28. 9:00:00",
      "Gross Amount": "3972.22",
      "Status": "N",
      "CurrencyCode": "EUR",
      "Items": [
      "Position": "0000000010",
      "QuantityUnit" : "EA",
      "Tax": "181.64",
      "ProductName": "First Item Name",
      "ProductID": "HT-1000",
      "Quantity": "1",
      "DeliveryDate": "2014-05-05T07:00:00.0000000",
      "CurrencyCode": "EUR"
      "Position": "0000000020",
      "QuantityUnit" : "EA",
      "Tax": "596.60",
      "ProductName": "Second Item Name",
      "ProductID": "HT-1002",
      "Quantity": "2",
      "DeliveryDate": "2014-05-05T07:00:00.0000000",
      "CurrencyCode": "USD"
      "SalesOrderID": "0500000030",
      "Netto Amount": "22337.00",
      "Time Stamp": "2014.04.28. 9:00:00",
      "Gross Amount": "26581.03",
      "Status": "P",
      "CurrencyCode": "EUR"
      "SalesOrderID": "0500000039",
      "Netto Amount": "3338.00",
      "Time Stamp": "2014.04.28. 9:00:00",
      "Gross Amount": "3972.22",
      "CurrencyCode": "EUR",
      "Status": "N"
    I can list the SalesOrders for the specific partner, and than list the items of the specific SalesOrder.
    Now I'd like to Approve the order, and change it's status from "n" to "P" in the JSON file as well.
    But I have no idea how to do it in the SalesOrderItem.controller.
    I hope someone can help me

    Since "BusinessPartnerList" and "SalesOrders"  are both arrays, i think you need some index in your path.
    if you want to adress a specific business partner and sales order, you would need something like oJsonModel.setProperty("/BussinessPartnerList/0/SalesOrders/1/Status" , 'P' );

  • Accessing data nested inside a JSON data source in Project Siena

    Hi all
    I'm trying to work with JSON data sources via REST in Project Siena. I can easily set up the JSON data source and get the data into my data sources list. However, the data is nested, so for example a REST request to search returns JSON data that is unpacked
    (correctly) as:
    search_query > entries > name
    I have tried two different REST-based data sources with the same result. I have tried accessing the data a couple of ways: firstly via a Gallery view and secondly just getting a listing with a DropDown.
    For this example, I've tried setting the Data items to search_query!entries (and a bunch of other things) with the idea that I could then refer to ThisItem!name and when that failed trying almost everything I could from the function reference
    http://siena.blob.core.windows.net/beta/ProjectSienaBetaFunctionReference.html#_Toc373745469
    Should this work? It seems like it's an extremely common structure for JSON returned from a RESTful service (top level containing count, pagination, other data and then a set of result details beneath).
    Any ideas appreciated. For completeness, the two data sources I've tried are the Box.com Content API (Search and Folders) and the ZenDesk API (Groups).
    Cheers.

    What you get back from the call is essentially a table with a single row--the "entries" column within that row have multiple rows that contain the name data. Try binding First(search_query)!entries to extract the name records. 

  • Invoking a method using reflection with json data as argument

    Hi,
    I want to invoke a method using reflection and this method have one argument . Now I want to pass a json data as an argument to this method .Please see the following code.
    int HelloWorld(int Id){
    return Id;
    json data{"Id":43}
    how can I use the reflection to use the json.
    Please provide your guidelines

    Thanks for your reply, I am building a windows console application .And I want to convert the json data to object array to use in Method Base.Invoke method.
    Regards,
    Ethan
    Maybe you could select the correct language development forum here:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages&filter=alltypes&sort=lastpostdesc
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Data Loader API Calls x Webservices

    Hi,
    I'm trying to use the Data Loader calls by the webservices.
    I've downloaded the OracleDataLoaderOnDemandImportServices.wsdl and I've been tested it in a C# project, but I don't know to use exactly the methods BulkOpImportCreateRequest and BulkOpImportSendData.
    I can't create a import bulk request...
    Has someone already used this before?
    Help me, please?
    Best regards,
    Herbert

    TheSilverHammer wrote:
    Thats some nice info, but what if it is not a "framework"? These are basic Darwin API calls, not Apple Frameworks.
    Last sentence on the page:
    "If you need to link to a library instead of a framework, you can use the -weak_library linker command instead of -weak_framework."
    TheSilverHammer wrote:
    I did not define printf so I can't weak link it.
    This doesn't make any sense. You didn't define any of the symbols in any of the frameworks or libraries Apple provides--that does not inhibit your ability to link against them, weakly or otherwise.

Maybe you are looking for

  • What is the difference between ProRes422 and ProRes422HQ?

    I'm curious about the difference - I'm working with HDV "24 fps" and using Compressor to remove the pulldown to allow editing in 23.98 fps using Apple ProRes422.  Everything I've looked at is silent or fuzzy on which circumstances would lead you to u

  • After an automatic update yesterday, I can only print email (Outlook Express 6) headers but the messages do not print

    After an automatic update yesterday, I started having problems printing emails from Outlook Express 6. The headers (e.g. To, From, Subject) print, but the messages do not print.

  • Rotation and email

    I would like to see two things in the bridge that I use all the time in my Nikon View. One is that bridge would recognize my rotation from the camera file and auto rotate (now that you and Nikon are buddies again) and that you could click on some ima

  • How to add column in Dynamic VO

    Hello All, We are on 11.5.10 and i am trying to add a column toProduct - Supplier Items - click Orders page when i click about this page it is showing this POS_SUPPLIER_INQUIRIES177_POS_PO_LINES_D2177_177POS_PO_LINES_DDynamicVO This has Dynamci VO. H

  • Cracked my screen now, touch screen not working

    i cracked my screen this morning, and after i finished work i only noticed the crack and whne i turned my screen on it, the screen would respond to me putting in my passcode to get onto my phone (nokia lumia 520)