求助:添加WCF服务引用出现的问题
类:
/// <summary>
/// 部门信息
/// </summary>
public class BMXX
{
/// <summary>
/// 部门ID
/// </summary>
public Guid ID { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string BMMC { get; set; }
/// <summary>
/// 部门职责
/// </summary>
public string BMZZ { get; set; }
/// <summary>
/// 添加时间
/// </summary>
public DateTime TJSJ { get; set; }
}
.cs
[ServiceContract]
public interface IBillManager
{
[OperationContract]
void Procss(List<BMXX> Bmxx);
}
调用WCF后无法自动生成以下代码:
using System.Runtime.Serialization;
using System;
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute(Name="BMXX", Namespace="http://schemas.datacontract.org/2004/07/WCF")]
[System.SerializableAttribute()]
public partial class BMXX : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
[System.NonSerializedAttribute()]
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private string BMMCField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private string BMZZField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private System.Guid IDField;
[System.Runtime.Serialization.OptionalFieldAttribute()]
private System.DateTime TJSJField;
[global::System.ComponentModel.BrowsableAttribute(false)]
public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
get {
return this.extensionDataField;
}
set {
this.extensionDataField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public string BMMC {
get {
return this.BMMCField;
}
set {
if ((object.ReferenceEquals(this.BMMCField, value) != true)) {
this.BMMCField = value;
this.RaisePropertyChanged("BMMC");
}
}
}
只有以下代码:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="ServiceBMXX.IServiceBMXX")]
public interface IServiceBMXX {
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IServiceBMXX/GetBMXX"
……………………
请各位帮忙指点指点,找找问题的原因,谢谢咯!
------解决方案--------------------
客户端添加的时候,在选项里把默认的 Array 改为 GenericList。
还有上面的代码“private string BMMCField;”,是怎么生成的?
[解决办法]
没看出什么问题。难道要 [KownType(typeof(BMXX))] 一下?
另外,你添加客户端时,出什么错误提示?