在“WCF客户端代理类”生成时,参数类型发生了变化。服务接口方法:
[OperationContract]
[ServiceKnownType(typeof(MonitoringsMonth))]
[ServiceKnownType(typeof(MonitoringsDay))]
[ServiceKnownType(typeof(MonitoringsYear))]
public List<Monitorings> GetWaterMonitoringEntityData(Monitorings.EnergyType energytype, KeyValuePairInfo<Monitorings.Period, string> monitordate, KeyValuePairInfo<Monitorings.MonitorType, string> monitortype, string meterusetype, bool issubstation)
{
List<Monitorings> MonitoringEntityDatas = new Mycems.BLL.WaterMonitoringDatas().GetMonitorDatas(energytype, monitordate, monitortype, meterusetype, issubstation);
return MonitoringEntityDatas;
} “KeyValuePairInfo”是自定以的参数类型,定义方法如下: [Serializable]
public class KeyValuePairInfo<TKey, TValue>
{
private TKey _key;
private TValue _value; public KeyValuePairInfo(TKey key, TValue value)
{
_key = key;
_value = value;
} public TKey Key
{
get { return _key; }
set { _key = value; }
} public TValue Value
{
get { return _value; }
set { _value = value; }
}
} 生成客户端代理类的参数类型如下: MyChartsService.KeyValuePairInfoOfMonitoringsPeriodstringfgNVcRZS two= new MyChartsService.KeyValuePairInfoOfMonitoringsPeriodstringfgNVcRZS(); MyChartsService.KeyValuePairInfoOfMonitoringsMonitorTypestringfgNVcRZS three = new MyChartsService.KeyValuePairInfoOfMonitoringsMonitorTypestringfgNVcRZS(); 问题: 1、为什么在WCF客户端代理类上,两个参数的类型发生了变化,而且两个参数的类型还不一样??? 2、“OfMonitoringsPeriodstringfgNVcRZS”和“OfMonitoringsMonitorTypestringfgNVcRZS”,怎么加上了这么长的一串??? “stringfgNVcRZS”表示什么呢???
[OperationContract]
[ServiceKnownType(typeof(MonitoringsMonth))]
[ServiceKnownType(typeof(MonitoringsDay))]
[ServiceKnownType(typeof(MonitoringsYear))]
public List<Monitorings> GetWaterMonitoringEntityData(Monitorings.EnergyType energytype, KeyValuePairInfo<Monitorings.Period, string> monitordate, KeyValuePairInfo<Monitorings.MonitorType, string> monitortype, string meterusetype, bool issubstation)
{
List<Monitorings> MonitoringEntityDatas = new Mycems.BLL.WaterMonitoringDatas().GetMonitorDatas(energytype, monitordate, monitortype, meterusetype, issubstation);
return MonitoringEntityDatas;
} “KeyValuePairInfo”是自定以的参数类型,定义方法如下: [Serializable]
public class KeyValuePairInfo<TKey, TValue>
{
private TKey _key;
private TValue _value; public KeyValuePairInfo(TKey key, TValue value)
{
_key = key;
_value = value;
} public TKey Key
{
get { return _key; }
set { _key = value; }
} public TValue Value
{
get { return _value; }
set { _value = value; }
}
} 生成客户端代理类的参数类型如下: MyChartsService.KeyValuePairInfoOfMonitoringsPeriodstringfgNVcRZS two= new MyChartsService.KeyValuePairInfoOfMonitoringsPeriodstringfgNVcRZS(); MyChartsService.KeyValuePairInfoOfMonitoringsMonitorTypestringfgNVcRZS three = new MyChartsService.KeyValuePairInfoOfMonitoringsMonitorTypestringfgNVcRZS(); 问题: 1、为什么在WCF客户端代理类上,两个参数的类型发生了变化,而且两个参数的类型还不一样??? 2、“OfMonitoringsPeriodstringfgNVcRZS”和“OfMonitoringsMonitorTypestringfgNVcRZS”,怎么加上了这么长的一串??? “stringfgNVcRZS”表示什么呢???
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货