Reading the data from a Web service

Hi all

I have a webservice that returns the square of the number.


< s0:ZJK_FLEX_TEST.Response xmlns:s0 = 
"urn:sap-com:document:sap:rfc:functions" 
xmlns:SOAP - ENC = 
"http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  
<DATA1>0000016</DATA1>
</s0:ZJK_FLEX_TEST.Response>

the data1 contains the value.


but I am not able to set this value in the text field in the flex.

function() {return A.apply (null, [this] .concat ($A (arguments)))}

public void result_getAll(event:ResultEvent):void

{

Alert.Show (Event.Result.ToString ());

Here, I would like to put the value in the text field.

}

What do you see with this:

Alert.Show (Event.Result.ToString ());

What happens if you do the following:

Alert.Show (Event.Result.Data1.ToString ());

If this post answers your question or assistance, please mark it as such.

Greg Lafrance - Flex 2 and 3 certified ACE

www.ChikaraDev.com

Support services and training, tutoring, Contracting, Flex

Tags: Flex

Similar Questions

  • Exception during consumption of huge data from a web service.

    Hello

    I m developing an application to receive data from a Web Service and retain the data received on the device.

    App is developed for OS 4.3.0

    The Web Service call is made using Ksoap. The Code receives the data from the web service, analyzes the data and stores it in an object. This object is then persisted on the device. The data are essentially the coordinates. It takes the number of contacts required as input and passes it to the Web Service. The Web Service then returns the requested number of records

    The code works if I ask data of up to ~ 600 cases. If I specify more than 600 cases, it throws the following exception

    Chain rg.xmlpull.v1.XmlPullParserException:unexpected type (position: TEXT entity request in T...@1:24 in java.io.InputStreamReader@1f87d1b4)

    When I debugged using Eclipse, this exception is thrown on this statement ht.call (soapAction, envelope);

    Would it be because of a time-out? OT is because the Analyzer is not able to analyze huge data?

    Given that this exception occurs on the declaration of ht.call, I guess the problem is with the web service call and not with the code for persistent storage.

    I have included the code here... Is could someone please show me what the problem is?

    C ode to call Web Services

    public Vector getWebData(String count)
        {
    
       Vector personsVectorto = new Vector();
        try
        {
        StringBuffer receivedContent = new StringBuffer();
        String serviceUrl = "........";
        String serviceNamespace = ".....";
        String soapAction = ".........";
    
       SoapObject rpc = new SoapObject(serviceNamespace, "GetContactsList");
            //rpc.addProperty("listSize", "5");
            rpc.addProperty("listSize", count);
         SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    
            envelope.bodyOut = rpc;
    
            envelope.dotNet = true;
            envelope.encodingStyle = SoapSerializationEnvelope.XSD;
            HttpTransport ht = new HttpTransport(serviceUrl);
            ht.debug = true;
    
            ht.call(soapAction, envelope); // This is where thexmlpullparser exception occurs
    
     Object obj = envelope.getResponse();
            SoapObject soapResult = (SoapObject)obj;
    
                for(int i=0; i < soapResult.getPropertyCount(); i++)
    
                {
                  PersonDTO personto = new PersonDTO();
               SoapObject choice = (SoapObject)soapResult.getProperty(i);
                if( choice!=null)
                {
                    for(int j = 0; j < choice.getPropertyCount(); j++)
                    {
                      receivedContent.append(" Reading Property Number" + String.valueOf(j) + " Value = " + choice.getProperty(j).toString());
    
         if (j==0) personto.setElement(1,choice.getProperty(j).toString());
        if (j==1) personto.setElement(2,choice.getProperty(j).toString());
        if (j==2) personto.setElement(3,choice.getProperty(j).toString());
        if (j==3) personto.setElement(4,choice.getProperty(j).toString());
        if (j==4) personto.setElement(5,choice.getProperty(j).toString());
         if (j==5) personto.setElement(6,choice.getProperty(j).toString());
         if (j==6) personto.setElement(7,choice.getProperty(j).toString());
          if (j==7) personto.setElement(8,choice.getProperty(j).toString());
         if (j==8) personto.setElement(9,choice.getProperty(j).toString());
       if (j==9) personto.setElement(10,choice.getProperty(j).toString());
                    }
                }                 
    
                personsVectorto.addElement(personto);
                //storepersistentobject(personsVectorto);
            }
    
            }catch(org.xmlpull.v1.XmlPullParserException ex2)
            {
                String bah1 = ex2.toString();
                Dialog.alert("String: " + bah1);
                String bah2 = ex2.getMessage();
                Dialog.alert("Message: " + bah2); 
    
            }       
    
            catch(Exception ex){
                String bah = ex.toString();
                Dialog.alert("Response: " + bah);
    
                }
    
                return personsVectorto;
        }
    

    Thank you

    Hi Philippe,.

    First Question: Print server response

    Yes - I think for you too in fact just print the answer you'll have to do a regular HTTP call to the server and print it like this:

    StringBuffer sb = new StringBuffer();

    int thumb;

    HttpConnection httpConn = (HttpConnection) Connector.open (url);

    httpConn.setRequestMethod (HttpConnection.GET); or by POST depending on your needs

    in = httpConn.openInputStream ();

    While ((thumb = in.read ())! = - 1).

    {

    SB. Append ((Char) inCh);

    }

    System.out.println ("server response:" + sb.toString ());

    Try and see if you get a request too large entity. Note: you should probably put your SOAP request in GET or POST http request.

    Second Question: Is zipping required?

    This is how I chose to do for my particular needs that transfer me a large amount of data and the compression algorithm seems to keep all my data well below 40 k. However, it is not the only way, you could actually make several requests and get data piece by piece, but I don't know if it works well with SOAP responses. Depending on the type of Network Setup Blackberry you have, you can also set this limit to be higher (I think a maximum of 1 024 Ko for BES).

    Third Question: Timeout Logging

    For wait times, usually the exception you get should indicate that there was a timeout, but if you are suspicious that it's a timeout check your web service and see.

    Hope that helps!

    R

  • How to read the data from a channel named in windows using labview

    Hello

    I need to read the channel named in windows data. The pipe is created by python by another application. This application post permanent data on the pipe. But I don't know how to read data using labview. is it possible to read the data from different application? If possible, how to start?

    Thanks in advance

    concerning

    RJ

    Hi Rolf,.

    It's just, because of driving is not initialized completely, pipe read returns error 42, I added 2 seconds late, then its work perfect.

    Thank you very much.

    Concerning

    RJ

  • How to fill a ComboBox with data from a Web service

    I have a simple application that contains a DataGrid control that gets its data from a web service. I prefer to put these data in a ComboBox instead of a DataGrid control. My web service returns objects.

    Someone has an idea how to do?

    < mx:DataGrid id = dataProvider = "{ws.getProjects.lastResult"dgProjects"}" > "
    ... < mx:columns >
    ... < mx:DataGridColumn dataField = "projectID" headerText = "ID of project" width = "100" / >
    ... < mx:DataGridColumn headerText = "Project name" dataField = "projectName" / >
    ... < mx:DataGridColumn headerText = "Doc UNID" dataField = "docUNID" visible = "false" / >
    ... < / mx:columns >
    < / mx:DataGrid >

    Exactly what I needed.

    Thank you very much!!!

  • Does anyone know how to get data from a web service of Labview with ajax or JSON?

    Hello

    I try to use ajax and json to service Web restful which I build with the labview. However I get errors

    For example. I create a web service from a labview vi (z = x / y http://localhost: 8080/math/divide/5/20 will give {Z: "4,000,000"})

    I get errors for the attached html files.

    Does anyone know how to get al labview WebService with ajax or json data?

    Thank you... Eran


  • Select the list box file and read the data from file

    I can list the files in the folder in the listbox

    1. I want to just list file .txt files

    2. How can I read data from the selected file (.txt)?

    I think that's what you want, enter a model in your list of files vi (for example, *.txt) and then just use File.vi text of reading by using the selected item in the list box (double click on event or value change) and use the starting for the vi records list path.  I have included a crude extract for your pleasure.

  • ADF Mobile Page with the data control of Web Service not showing latest results

    Hello

    I developed a simple mobile application of ADF. It has two functions members and subscriptions. These two pages are part of my Taskflow. On the members page I show all members in a list by using the Web Service method data Find command. In the list item have a listener property Set where I'm storing MemberId in a variable of pageFlowScope for action. On the subscription page, I have a bar graph that gets the data with the help of a Find method in control of data to the Web Service. The find method is based on a view created criteria which has a member ID of input parameter. in the model of ADFBC project. I connected the variable using the AMX page binding. The variable is being levied on the pageFlowScope variable.

    The page displays the chart first to a member. And shows the same graph for the other members. I printed the memberId variable and it shows the value of the respective members. But the cards are not get updated every time I select new Member.

    I use JDeveloper 11.1.2.4.0.

    Any suggestions?

    Thank you

    Mehabub

    Go to the Connections tab, and then click the Green plus sign on the central section - you need to add a 'invokeAction. Give it a name, and then select the iterator that built the table, and that's all you should have to do. The invokeAction fires whenever you visit the page and should update the list.

    Rich,

  • is it possible to return a figure to the database from a web service

    I have a REST web services configuration that has 4 values

    Is it possible to use a db call to enter these 4 values that can be used in an insert in the database?

    Thank you

    Yes it is available: [url http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/t_dburi.htm#i1007928] 10.2 documentation packages and Types.

    You must copy my blog instead: my answer was typo with a T too much ;-)

    Edit: Fixed the URL

    Published by: Kim Berg Hansen on October 19, 2012 10:00

  • Reading the data from a fichierXML

    I was given a measurement file that is stored in XML format, I need to extract some data.  I spent a large part of the morning passes through all XML I could find trying to figure out how to start.  I also downloaded the packages GXML and EasyXML VI.  The problem is that I can't seem to figure out how to use one of these files because all of the examples I see are beautiful small files and I don't know how to apply them to my folder.

    The first thing I'm doing is to extract data, called CentralTilt.  If I look at the XML mapping in Excel it would report the acquisitions-> SystemConfig-> data.  In Excel when I extract these data, I get a column of values about 1200.  I'm trying to do the same thing, but place them in a table in Labview.

    At the end of the day, I need to do a several other values in the file and then perform additional handling, this is why I would try to automate this process in Labview.  I think that if I can just go beyond this first hurdle to not really understand how these different functions of XML called on the file and analyze the data I should be able to figure out the rest.  Some advice would be appreciated.    Thank you.

    Unfortunately, I can't post the file as it is too big, but I have a screen capture of the XML mapping.

    Received warnings during conversion, you may need to replace a part of the used screw (load and close screw).

    Ben64

  • Reading the data from an Excel file

    Hello

    I try to use the attached VI (adapted from an example provided by someone else in a different thread) to read an Excel file.

    It works well, aside from the fact that it leaves the file and Excel opened when it has finished running.

    How do I close the file (and Excel) by programming?

    Thank you very much

    Dan

    Try this.

  • Reading the data from the XML file to the SQL Tables.

    I have XML of this type

    < empdept >
    < employees_marks >
    < emp_id > 1 < / emp_id >
    BUS from < DIVISION_ID > < / DIVISION_ID >
    PRE < JOB_ID > < / JOB_ID >
    SMITH of < first-name > < / name >
    JAMES < LAST_NAME > < / LAST_NAME >
    < > 10000 salary < / salary >
    < / employees_marks >

    < dept >
    < dept_details >
    < deptid > 10 < / deptid >
    < deptname > mechanical < / deptname >
    < / dept_details >
    < dept_details >
    < deptid > 20 < / deptid >
    < deptname > civilian < / deptname >
    < / dept_details >
    < dept_details >
    < deptid > 30 < / deptid >
    < deptname > ICE < / deptname >
    < / dept_details >
    < / dept >
    ((< / empdept > '));

    With the above format am able to recover data successfully to relational tables.


    < employees_marks emp_id = 1 DIVISION_ID = BUS JOB_ID = salary PRE = 10000 / >


    < dept_details deptid = 10 deptname = "Mechanical" / >
    < dept_details deptid = 20 deptname = "ECE" / >
    < dept_details deptid = 30 deptname = "EEE" / >

    that is, I have data as attributes rather than elements, if can I know the way how can I reach the requirement.

    How to recover data when it is present as attributes rather than elements.

    Thank you
    Sunil. N
    with temp as (
      select xmltype('') tempxml from dual
    )
     SELECT extractvalue(tempxml,'/employees_marks/@emp_id') empid,
      extractvalue(tempxml,'/employees_marks/@DIVISION_ID') divid ,
      extractvalue(tempxml,'/employees_marks/@JOB_ID') jobid      ,
      extractvalue(tempxml,'/employees_marks/@salary') sal
       FROM temp
    

    Do you need this?

    Ravi Kumar

  • reading the data from an object

    I know how to do something like that to show an ID value:

    My $basevm_view = Vim::find_entity_view (view_type = & gt; 'VirtualMachine', filter = & gt; {'name' = & gt; "myguestvmname"});

    Print "my ID =". "." $basevm_view - & gt; Summary - & gt; config - & gt; ID. "\n";

    Can I get the ID using the accessor method? If so, what is the snippet of perl code that prove? I'm trying to understand what all of the accessor methods are for, so if they are not for this sort of thing, a quick explanation would really help this newby.

    Thank you.

    As has been pointed out by William, it is not really of accessor methods directly and as you have discovered, the object is exposed as a series of nested, anonymous hashes.

    You can create a utility function if you want a cleaner accessor.  It's probably a good idea since you can create exceptions in there and avoid a lot of messy test code in your branch of the main logic.

    Something like the following would be a good starting point:

    #!/usr/bin/perl
    
    use strict;
    use warnings;
    
    use VMware::VIRuntime;
    
    Opts::parse();
    Opts::validate();
    
    Util::connect();
    
    my ($host_views);                                   
    
    $host_views = Vim::find_entity_views( view_type => "HostSystem",
                                                  );
    
    foreach ( @{$host_views} ) {
         print "summary.config.name = " . get_value($_, "summary.config.name") . "\n";
         print "summary.managementServerIp = " . get_value($_, "summary.managementServerIp") . "\n";
         print "summary.bogusProperty = " . get_value($_, "summary.bogusProperty") . "\n";
    }
    
    sub get_value {
         my ($entity, $value_path) = @_;
    
         my @keys = split(/\./, $value_path);
    
         my $key_ref = $entity;
         foreach my $key ( @keys ) {
              eval {
                   $key_ref = $key_ref->{$key};
              };
              if ($@ || not(defined($key_ref)) ) {
                   return '';
              }
         }
    
         return $key_ref;
    }
    

    Example of output:

    summary.config.name = vlab-esx-01.vlab.local
    summary.managementServerIp =
    summary.bogusProperty =
    

    That function will catch at least undefined properties (not all the properties of the SDK are guaranteed and access them may throw an exception).  To do this, he makes an empty string to avoid warnings from perl on indefinite concatenations.

    Keep in mind if you are using the properties-online arguments appointed for your find_entity_view calls, you will need to access the properties as a full key path.  By example, if requested just 'summary.config.name' in such a manner, you acceding it starting from the host as object $_-> {'summary.config.name'}.

    You could easily improve the fortune above accessor method to check this possibility (I just eval the full path key, if that throws an exception, go through the list of keys as usual).

    It might help if you find a little frustrating to work with long anonymous hash references, nested.  I know I find it's ugly when I have to deal with many nested hash refs and validate each in the string is not undefined (destroyed by the SDK return).  I use similar accessor methods to avoid my code getting ugly for more complicated work of perl.

  • reads the data when I select run

    When I insist on running my program reads the data from the meter power... when I'm not it gives me an error. I tried to put right waiting them etc and nothing seems to be set. Also, when I take the vi that read data from the electricity meter, the code runs much faster. I don't know if this has to do with global variables or what, but I just change a code supplied with this unit and it included global variables. I tried not to play with those yet. Anyway, if someone sees something that would eventually cure this problem please let me know. Thank you.


  • How to read the data file

    Hello
    I have red the DBW do that beside Scripture, is that correct?

    Thank you

    Jin

    DBWR writing data in data file... hope that the server process reads the data from the data file...

    Kind regards
    Deepak

  • Unable to delete the data from the Safari Web site...

    Hello.

    I need help with my Safari browser on my Mac.

    Im trying to remove all Web site data with the following procedure:

    Safari-> Preferences-> privacy-> Remove All Data Web site...

    His does not work. Before clicking on the button I have 108 Web sites stored cookies or other data, I click the button, and nothing happens... I'm still 108 cookies.

    I also did the following:

    . - activate the Menu developer and Cache empty and tried again... nothing

    . - used CleanMyMac v3 and it says I don't have cookies.

    . - order iCloud Sync of Safari on the computer and try again... same problem

    . - removed manually com.apple. Safari. Secure

    Any help will be great. Please let me know if you need any additional info.

    Thank you.

    Hello DZanvettor,

    Thank you for using communities of Apple Support.

    If I understand your message that nothing happens when you try to remove the Safari Web site data. I know how it is important for you to be able to remove the Safari Web site data. I recommend that you restart your Mac into safe mode and see if you can remove the data from the Web site in secure mode.

    Here are the steps to restart your Mac in safe mode:

    Safe mode (sometimes called secure boot) is a way to start up your Mac so that it performs certain checks and prevents certain software from loading automatically or opening.

    From your Mac in safe mode does the following:

    * Check your startup disk and attempts to fix problems if necessary directory
    * Loads only required kernel extensions
    * Prevents the elements start and the login items open automatically
    * Disables installed user fonts
    * Delete font caches, hiding the kernel and other files of the system cache
    * Together, these changes can help resolve or isolate issues related to your startup disk.

    Follow these steps to start in safe mode.

    1. start or restart your Mac.
    2. as soon as you hear the startup tone, hold down the SHIFT key.
    3. release the SHIFT key when you see the Apple logo appears on the screen.

    After you delete data from the Web site in safe mode restart your Mac and allow it to start up as usual. Then test the issue again.

    Best regards.

Maybe you are looking for