header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Ashok
Points:0
Posts:0

9/8/2010 3:18:07 AM

Title: Laishram


While connecting webservices from flex client using axis with Java, is it possible to get data from the java program (in Object format )?



1
bob_senior
Points: 1300
Posts:0
9/8/2010 5:12:11 AM



you can load the data as text or variables only. Flex does not support loading objects. To load a data it should be formatted in the GET request format separated by & character :

var1=value1&var2=value2

2
ashok
Points: 0
Posts:0
9/8/2010 6:32:47 AM



Actually the issue is when I am trying to communicate with java using axis.I am trying to get the hashMap values from java and decode it in flex. It's not working.

Thanks



import java.sql.*;
import java.util.*;

public class PowerplantWebServices {

    public String name ="";
    
    public String severityLevel = "";
    
    public String geeksType = "";
    
    public String post = "";
    
    public int age =0;

    public List records;

    
    
       
    public List mouseOver(){
    
        System.out.println("Getting All Rows from a table!");
        Connection con = null;
        String url = "jdbc:mysql://localhost:3306/";
        String db = "ppdb";
        String driver = "com.mysql.jdbc.Driver";
        String user = "root";
        String pass = "root";
        List ls = null;
        
        try{
          Class.forName(driver).newInstance();
          con = DriverManager.getConnection(url+db, user, pass);
          try{
            Statement st = con.createStatement();
            ResultSet res = st.executeQuery("SELECT * FROM  mouseOver");
            //System.out.println("Emp_code: " + "\t" + "Emp_name: ");
           
            
           
            
            records = new ArrayList();
            
            int i =0;

            while (res.next()) {

              Map hm = new HashMap();
              name = res.getString("name");
              severityLevel = res.getString("severityLevel");
              geeksType = res.getString("geeksType");
              post = res.getString("post");
              age = res.getInt("age");

              hm.put("name", name);
              hm.put("severityLevel", severityLevel);
              hm.put("geeksType", geeksType);
              hm.put("post", post);
              hm.put("age", age);


              records.add(hm);
//              records.add(severityLevel);
//              records.add(geeksType);
//              records.add(post);
//              records.add(age);
              

              
              System.out.println("name:::"+hm.get("name")+" severityLevel"+hm.get("severityLevel")+" geekdType"+geeksType+" post"+post+" age"+hm.get("age"));
            }
            
            con.close();

          }
          catch (SQLException s){
            System.out.println("SQL code does not execute.");
          }
          
        }
        catch (Exception e){
          e.printStackTrace();
        }
        
        ls = records;
        return ls;

    }


    public String hello(String name) {
        return "Hello "+name;
    }


    public static void main(String[] args){
        PowerplantWebServices pws = new PowerplantWebServices();
            pws.mouseOver();
    }

}




Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 5+8 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions