0
我耗费这是我返回结果类型的“ArrayOfKeyValueOfintstring”使用字典中的Java
我很困惑如何将这些数据在java中添加到我的组合框中选择一个Web服务组合框操纵。
这里是我的代码
org.tempuri.ThirdPartyService service = new org.tempuri.ThirdPartyService();
org.tempuri.IThirdPartyService port = service.getBasicHttpBindingIThirdPartyService();
// TODO initialize WS operation arguments here
java.lang.String key = line.trim();
// TODO process result here
String>)port.getTests(key).getKeyValueOfintstring();
com.microsoft.schemas._2003._10.serialization.arrays.ArrayOfKeyValueOfintstring result = port.getVulnerabilities(key);
编辑
for(int i=0;i<=result.getKeyValueOfintstring().size();i++)
{
result.getKeyValueOfintstring().get(i).getKey();
result.getKeyValueOfintstring().get(i).getValue();
JOptionPane.showMessageDialog(null, "key is"+result.getKeyValueOfintstring().get(i).getKey());
JOptionPane.showMessageDialog(null, "Value is"+result.getKeyValueOfintstring().get(i).getValue());
model.addElement(new Item(key, value));
}
我试图让在对话框中的密钥对和我正确地得到它。但现在我没有得到如何将它们添加到我的组合框。我创建了表格“Vector model = new Vector();”并像这样将它添加到组合框中“cbTestName = new JComboBox(model);”
这是正确的方式,还是我需要应用任何其他功能将键值对添加到我的组合框中。
这里键我通过作为参数是我的身份验证密钥,而不是从“键值”对 – 2013-04-24 09:01:46
您评论getKeyValueOfintstring()声明? – evgenyl 2013-04-24 09:30:42