C# 如何从wcf ksoap2响应填充字典

C# 如何从wcf ksoap2响应填充字典,c#,java,android,wcf,dictionary,C#,Java,Android,Wcf,Dictionary,我有一个wcf ksoap2服务,它返回字典。现在在android端,我想填写我的字典用语来自wcf响应。我不熟悉wcf和android/java,我不知道该怎么做。请给我提供一些更好的例子,用wcf填充字典 提前谢谢 这是我的wcf代码 public Dictionary<ArrayList, List<byte[]>> getImages() { Dictionary<ArrayList, List<byte[]&g

我有一个wcf ksoap2服务,它返回
字典
。现在在android端,我想填写我的
字典用语来自wcf响应。我不熟悉wcf和android/java,我不知道该怎么做。请给我提供一些更好的例子,用wcf填充字典

提前谢谢

这是我的wcf代码

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;
        }
公共字典getImages() { 字典图像_Name=新字典(); DirectoryInfo DirectoryInfo=newdirectoryinfo(@“C:\Users\Yakhtar\Desktop\abc”); arr1=新的ArrayList(); foreach(directoryInfo.GetFiles()中的FileInfo-fi) arr1.添加(fi.全名); 列表=新列表(); for(int i=0;i
我不确定,但您是否考虑过JSON解析而不是ksoap2

这是一本书。经过无数个小时的调试,我发现了这一点。希望这次和平

也试试这个

SoapObject countryDetails = (SoapObject)envelope.getResponse();
System.out.println(countryDetails.toString());

ArrayList list = new ArrayList(countryDetails.getPropertyCount());
lv_arr = new String[countryDetails.getPropertyCount()];
for (int i = 0; i < countryDetails.getPropertyCount(); i++) {
    Object property = countryDetails.getProperty(i);
    if (property instanceof SoapObject) {
        SoapObject countryObj = (SoapObject) property;
        String countryName = countryObj.getProperty("countryName").toString();
        list.add(countryName );
    }
}
SoapObject countryDetails=(SoapObject)信封.getResponse();
System.out.println(countryDetails.toString());
ArrayList list=新的ArrayList(countryDetails.getPropertyCount());
lv_arr=新字符串[countryDetails.getPropertyCount()];
对于(int i=0;i
像这样做

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;
        }
list=newlist();
for(int i=0;i