Post JSON data.

How do I post JSON data through the data services of Flash Builder 4? Are there any examples?

These are my favorite links on the suject:
http://www.switchonthecode.com/tutorials/using-flex-php-and-json-to-modify-a-mysql-databas e
If this post answers your question or helps, please mark it as such.
http://www.switchonthecode.com/tutorials/flex-php-tutorial-transmitting-data-using-json
http://www.switchonthecode.com/tutorials/flex-php-json-mysql-advanced-updating
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com

Similar Messages

  • Post json data on wcf servive

    Hello friends ,
    i need your help in setup a wcf service which can accept JSON ,
    i want to post JOSN data on wcf .
    i am trying from last few days but not achieve success .
    i tried each and every port .
    can some one help me what exactly config and attibutes i required to setup.
    Regards,
    Mohit Gupta

    Is this for a SOAP Service (BasicHttp, WSHttp) or REST (webHttp). I assume the latter, since SOAP is usually XML.
    If you need to work with REST and JSON, you need to use:
    The WCF-WebHttp Adapter
    The JSON Pipeline Components:
    http://blog.vertica.dk/2014/06/28/working-with-json-in-biztalk-server-2013-r2/
    Morten la Cour

  • HttpService POST json -  Error #2032

    Hi,
    I'm trying to POST json data to my Rest Service (please find code snippet below). On the faultHandler I get the following error
    message    "faultCode:Server.Error.Request faultString:'HTTP request error' faultDetail:'Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: https://135.123.128.9/mgmt/Users"]. URL: https://hostname/mgmt/Users'" 
    <code>
         private function clickHandler(event:ItemClickEvent):void {
                        var user:User=new User();
                        user.loginName= login.text;
                        user.surname= lastName.text;
                        user.givenName= firstName.text;
                        user.userPassword=password.text;
                        createUserHttpService.contentType="application/json";
                        createUserHttpService.send(JSON.encode(userCopy));
          <mx:HTTPService id="createUserHttpService" 
                          useProxy="false" method="POST" result="userByUserIdServiceResultHandler(event);"
                           url="https://135.123.128.9/mgmt/Users"   fault="createUserServiceFaultHandler(event);" showBusyCursor="true" />                 
    </code>
    Thanks in advance
    ~Shankar

    #1 - yes
    #2 - yes, but im able to do GET on the same server and also POST for  content-type="text".
    Can there be something specific if content-type="application/json" and POST  ?
    Alternatively if someone can provide me a small code snippet which sends  json in the body of a POST request using HttpServic, that would be great as  well.. may be im missing something my code
    Thanks

  • How to POST the data though Rest services though composite object.

    I am new to REST services.
    I need to write REST Serivices to post(Update) the data using Composite object.
    I created the structure to pass the composite object from jquery to the REST services.
    How can i handle that composite object in REST Services URITemplate and interface methods.
    can i have sample code to handle the composite object in REST Services?
    Thanks in advance.

    Did you check this post?
    http://sharepoint.stackexchange.com/questions/25222/posting-json-to-a-rest-wcf-endpoint-in-sharepoint-using-cksdev
    --Cheers

  • C# Parsing JSON data within Mobile project OR via Controller Issue

    When I invoke the following to a custom controller to return data to my client (Windows Phone 8.1 app):
    var _lines = await App.MobileService.InvokeApiAsync<List<Tfl.Api.Presentation.Entities.Line>>("lines", System.Net.Http.HttpMethod.Get, new Dictionary<string, string>
    {"url", "http://api.tfl.gov.uk/Line"}
    I received the following Exception:-
    FileNotFoundException was caught
    Could not load file or assembly 'System.Runtime.Serialization,
    Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one
    of its dependencies. The system cannot find the file specified.
    However, I successfully parse the JSON data via the controller [I did have an image here displaying the data, but not enough rep to post!] and I also have no references to the above dll in my Windows Phone application.
    Any ideas?
    Note: Occurs using either local parsing within the mobile app or via controllers in a service app; also running VS Ultimate 2013 with Update 4

    Hi James,
    The data is deserializing using System.Runtime.Serialization 4.0.0.0 on the client side (which is targeting .NET 4.5). I am using a third party DLL found here (api.tfl.gov.uk) which contains all of the data transfer objects required to map the data from
    the JSON into an object structure.
    I have tested this DLL also within a console application and runs as expected, deserializing and mapping data etc; could the issue be that the DLL I'm using containing DataContract and DataMember annotations cannot be used as a reference within the Windows
    Phone 8.1 app?
    I say this because I have a solution whereby I 'copy' the DTO modes in the DLL into plain models using the same code (minus Serialization annotations) and the JSON then is able to deserialize and map to those in the phone.
    So the solution are present is to create my own models, however if you've any other ideas/workarounds that would be great to know in the future where I can just reference the third party DLL.
    Thanks for the response!
    --David

  • JSON.parse: unexpected non-whitespace character after JSON data

    I am having problem using cold fusion and jquery.ajax it will throw error
    JSON.parse: unexpected non-whitespace character after JSON data
    this is the response in firebug {"EMPCODE":"E-00001"}
    child.cfm
      <cfif IsDefined("empmycode")>
             <cfset  myarray= getempCode(#mycode#)>
             <cfoutput>#myarray#</cfoutput>
      </cfif>
    <cffunction name="getempCode">
           <cfargument name="empcode">
             <cfquery  name="empQuery" datasource="#datasource#">
                   Select empcode from employee where empcode = '#empcode#'
             </cfquery>
                <cfset mystruct = StructNew()>  
                <cfset mystruct.empcode=#empQuery.empcode#>
            <cfreturn   SerializeJSON(mystruct)>
      </cffunction>
    parent.cfm
    $.ajax({
        type: 'post',
            data: {empmycode:empcode}, 
        url: 'child.cfm',
        success:function(data){
        var myobjc = jQuery.parseJSON(data);
        console.log(myobj.empcode);
    Thank you in advance

    jemz wrote:
      <cfif IsDefined("empmycode")>
             <cfset  myarray= getempCode(#mycode#)>
             <cfoutput>#myarray#</cfoutput>
      </cfif>
      <cffunction name="getempCode">
           <cfargument name="empcode">
             <cfquery  name="empQuery" datasource="#datasource#">
                   Select empcode from employee where empcode = '#empcode#'
             </cfquery>
                <cfset mystruct = StructNew()>  
                <cfset mystruct.empcode=#empQuery.empcode#>
            <cfreturn   SerializeJSON(mystruct)>
      </cffunction>
    The above code is confusing. You test for the existence of empmycode, yet you actually use mycode instead. In addition, what you call an array isn't, and you fail to 'var' the method's local variables.
    You could modify the code, by scoping, as well as bearing in mind what Carl has said:
    <cfif IsDefined("form.empmycode")>
        <cfset  code= getempCode(form.empmycode)>
        <cfoutput>#code#</cfoutput>
    </cfif>
    <cffunction name="getempCode">
    <cfargument name="empcode">
    <cfset var mystruct = StructNew()>
    <!--- Alternative:  <cfqueryparam cfsqltype="cf_sql_varchar" value="'#arguments.empcode#"> --->
             <cfquery  name="empQuery" datasource="#datasource#">
                   Select empcode from employee where empcode = <cfqueryparam cfsqltype="cf_sql_integer" value="'#arguments.empcode#">
             </cfquery>
    <cfset mystruct.empcode=empQuery.empcode>
    <cfreturn   SerializeJSON(mystruct)>
    </cffunction>

  • JSON Data Problem

    I am receiving the JSON data from Delicious perfectly however
    when I got to target it using jsonObj.Delicious.posts all I get
    returned is undefined. However, if I simply trace jsonObj I can see
    that it is working properly. What am I missing?

    BINGO !
    works like a charm
    I used this at compReady. Loads all the animated thumbnails with image, jersey number and full name.
    $.getJSON('images/profiles.json', function(json)
                sym.getComposition().getStage().setVariable('data', eval(json));
                var data = sym.getComposition().getStage().getVariable('data');
                for ( i = 1 ; i < 17; i++){
                    sym.getSymbol("thumb"+[i]).$("thumb1").css("background-image","url("+data.player[i].thumb +")");
                    sym.getSymbol("thumb"+[i]).$("j_num").html(data.player[i].j_num);
                    sym.getSymbol("thumb"+[i]).$("p_name").html((data.player[i].f_name)+"<br>"+(data.player[i ].l_name));
    sym.$("Stage").css({"margin-left":"auto","margin-right":"auto"});
    and this on all the "display on click" profile sheets. Right now just gets the larger player pic but will get all the other "fields" also when complete
    var i = 1 // this var identifies the player
    var data = sym.getComposition().getStage().getVariable('data');
    sym.$("player_image").css("background-image","url("+data.player[i].image+")");
    sym.play("profile" + [i]);
    Works perfect. Now I just have to add all the other fields to the profile sheets and presto...
    thanks again
    Joel

  • Ajax call method which return json Data

    Hi, I make one function , which i want to return json value , for this which return type i mention in function:
    This is javascript which call Retrieve method.
    <script>
    debugger;
             var remoteDatasource = new kendo.data.DataSource({
                 transport: {
                     read: {
      type:"POST",
      url: "Controllers/Home.cfc",
      dataType: "json",
                         data: {
      method: "Retrieve",
                             dataLists: JSON.stringify(request)
    </script>
    Home.cfc
    component
    remote   function Retrieve(string dataLists)
      try
                q = new Query();
                q.setsql("SELECT * FROM Product");
                qResult = q.execute().getresult();
                col_len = ListLen(qResult.Columnlist);
                dataArray = ArrayNew(1);
                row = 0;
                col = 0;
                for(row = 1; row <= len; row++)
                     for(col = 1; col <= col_len; col++)
                          FieldName = ListGetAt(qResult.Columnlist, col);
                          dataArray[row][col] = qResult[FieldName][col];
          jsonvar=serializeJSON(dataArray);
      catch(any e)
    return jsonvar;

    One can see immediately that you have to make the following corrections, at least:
    Give the query a name;
    Point the query to a datasource;
    Define the variable 'len' (even better, use a different, less confusing, name for the variable).

  • 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

  • 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

  • ALE error while posting payroll data

    Hi all,
    We are trying to set up payroll posting via ALE interface. We have done the following settings
    1. Distribution model setup with filters on for standard bapi's
    2. Partner profile setup
    3. RFC destination setup
    When we try to post payroll data,it was returned with the following errors
           RFC destination is not maintained for object BUS6001 and method PRECHECKPAYROLLACCOUNTASSIGN
           The account assignment objects could not be checked
           RFC destination is not maintained for object BUS6004 and method CHECK
           The G/L account could not be checked
    We verified RFC destination and it is working fine. I have searched all possible links in SCN, but unable to get the solution.
    Can someone help in this issue?

    Hi,
    Using tcode pc_payresult please check whether the off-cycle payroll is executed again in period 06-2010. If yes then try to post off-cycle payroll separately (PC00_M99_CIPE - Create Posting Run) by entering "Off-Cycle Payroll Run" parameters. May be you will get an error while posting this off-cycle payroll because this payroll is already posted. In this case you will have to reverse the existing off-cycle posting and then post off-cycle payroll again.
    Once off-cycle payroll is posted, then you try to post normal monthly payroll.
    I hope your problem will be solved by doing the above work out.
    Regards,
    Waqas Rashid

  • 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!

  • Posting huge data on to JSP page using JSTL tags

    Hi,
    I have one application where I have to post huge data (approximately 2000 rows of data) into JSP page. I am using JSTL tags and running on Tomcat 5.
    It is taking almost 20 to 25 seconds to load the entire page.
    Is it the optimal time to load or it could be improved?
    Please let me know.
    Thanks,
    --Subbu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi Evnafets,
    Thank you for the response.
    Here are the tasks I am doing to display the data on JSP.
    0. We are running on Tomcat 5 and the memory size is 1024MB (1GB).
    1. Getting the data - I am not performing any database queries. The data is stored in the static cache memory. So the server side response is so quick - less than a milli second.
    2. Using Java beans to pass data to the presentation layer (JSP).
    3. 10 'if' conditions and 2 'for' loops and 2 'choose' statements are being used in the JSP page while displaying the data.
    4. Along with the above, there are 4 javascript files are being used.
    5. The jsp file size after rendering the data, is aprox. 160 kb
    Hope this information helps you to understand the problem.
    Thanks,
    --Subbu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Acrobat form with server side submit, posting blank data

    Read more
    Acrobat form with server side submit, posting blank data,
    thanh xả tràn
    I have a PDF form which gets submitted to the server using a submit (server-side) button. The data is then received in XML format by a ColdFusion component which does some validation and stores it into the database.
    This PDF form is usually filled in by our clients using Adobe Reader 8 or below. While most of the times(and I mean like 96-97% of the times) everything goes well, at times we receive blank data into our database!! This renders couple of other features in our application useless as they try to parse an XML which does not exist.
    I do believe that this is not a problem at the ColdFusion side because all it does is trim(ToString(toBinary(GetHttpRequestData().content))).
    Does anyone has a clue as to why the data will be lost upon form submission?? I have done a lot of googling around it but in vain!

    There is an outside chance someone is just playing with you and submitting a blank form. Not uncommon if someone is not too familiar with forms.

  • 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

Maybe you are looking for

  • Connecting to itunes store wont work, but internet works?!

    Hi guys. For some reason My mac wont let me connect to the itunes music store. it works on any website and says its connected to the internet(( which it is)) and yea. i need it to work. does anyone know what the problem is? because maybe its the fire

  • OS-X 10.5.8 Shutdown Cause -4?

    My old white MacBook has started to shutdown unexpectedly.  The system log is showing a shutdown cause of -4.  I suspect that it's overheating.  Can anyone confirm that -4 is a thermal panic, and if not, what does it mean?  I've done some digging but

  • Regions same height

    Hi there, I'm running apex 4.1 on a 11g database and i'm trying to put 2 regions side by side and i wan't to make them the same height. I observed that each #REGION_POSITION# creates a table in the HTML of the page and each column set in the region c

  • IMovie exporting questions, please help!

    Hi, I'm trying to transfer a home movie from a video camera and make it a quicktime file. 1st of all: Do I have to go through iMovie? Or can it just import as a quicktime movie? 2nd of all: in iMovie, is the only way to import it to import it as it p

  • Inspection Lot generation for Movement type 101-O

    Hi I would like to know, which config / Master data need to generate Inspection Lot for Movement type 101-O. I enter subcontract vendor number and set 'SC Vendor' indicator in purchase order delivery address tab and I created QM data in Material Mast