Web服务返回类型是键和值对的数组。那就是:
namespace WebReference
{
[Serializable]
[GeneratedCode("System.Xml", "4.0.30319.18408")]
[XmlType(Namespace = "http://xml.apache.org/xml-soap")]
[DebuggerStepThrough]
[DesignerCategory("code")]
public class mapItem
{`enter code here`
public mapItem();
[XmlElement(IsNullable = true)]
public object key { get; set; }
[XmlElement(IsNullable = true)]
public object value { get; set; }
}
}
- >我已经消费过如下......
//created proxy class
WebReference.IngeniumCMSWebServService ws = new WebReference.IngeniumCMSWebServService();
//Accessed webservice method Here I getting null value
WebReference.mapItem[] items = ws.getPolicyInquiryAllDetails(polacyNumber);
//string ff = dictionary[gg.key].ToString();
Logger.LogMessage("====================================================================");
foreach (var item in items)
{
Logger.LogMessage("key: " + item.key + " Value: " + item.value);
}
Logger.LogMessage("====================================================================");
}
}
在访问方法时,我在Items处获得空值...
请指导我,我怎样才能获得价值...... web服务链接是正确的,换句话说,我得到了xml文件,我检查了xml,有值...如果我按照这种方式,我没有得到值,它显示空值。