Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I have a wcf ksoap2 service that returns
C#
Dictionary<ArrayList, List<byte[]>>;

Now at android side I want to fill my
Java
Dictionary<String[], ArrayList<Object>> diction;

from wcf response. I am new to wcf and android/java, I don't have idea how to do this. Please provide me some better example of filling Dictionary with wcf.

Thanks in advance

This is my wcf code

C#
public Dictionary<ArrayList, List<byte[]>> getImages()
        {
            Dictionary<ArrayList, List<byte[]>> image_Name = new Dictionary<ArrayList, List<byte[]>>();
            
            DirectoryInfo directoryInfo = new DirectoryInfo(@"C:\Users\Yakhtar\Desktop\abc");
            arr1 = new ArrayList();
            foreach (FileInfo fi in directoryInfo.GetFiles())
                arr1.Add(fi.FullName);



            list = new List<byte[]>();
            for (int i = 0; i < arr1.Count; i++)
            {
                img = Image.FromFile(arr1[i].ToString());
                ms = new MemoryStream();
                img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
                list.Add(ms.ToArray());
            }

            image_Name.Add(arr1, list);
            //image_Name[arr1 as ArrayList] = [list as byte[]];
            return image_Name;
}
Posted
Updated 16-Jan-14 3:13am
v2
Comments
Krunal Rohit 17-Jan-14 13:11pm    
Have you thought about JSON parsing instead of ksoap2 ??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900