這是我的問題。如果我像這樣撥打回撥號碼:取決於參數的WCF回調錯誤
clients[computerID].PrintLabelCallback(label);
通道故障,我在客戶端發生CommunicationFault異常。呼叫是一種方式在服務器端不會造成任何問題。
如果我這樣稱呼它不過:
label.EntryLocation = null;
label.EntryUser = null;
label.ResultLine = null;
label.Printer = null;
label.Type = null;
clients[computerID].PrintLabelCallback(label);
凡EntryLocation,EntryUser等是我所定義的類。我不必清空基本類型,如String
,int
。那些穿過電線的事件沒有發生。似乎兩邊都使用了相同的類型,所以我不確定這是否失敗。
這是什麼原因造成的?我將如何解決它?
編輯:這裏是我的班級和相關領域的定義。
[DataContract(IsReference = true), JsonObject(IsReference = false), Serializable]
public partial class Label : Interfaces.IRQSObject
{
/// <summary>
/// The location where the Label was created.
/// </summary>
[DataMember(EmitDefaultValue = false)]
public virtual Location EntryLocation { get; set; }
/// <summary>
/// The user that Generated the Label
/// </summary>
[DataMember(EmitDefaultValue = false)]
public virtual User EntryUser { get; set; }
/// <summary>
/// The printer that this label will be printed out at
/// </summary>
[DataMember(EmitDefaultValue = false)]
public virtual LabelPrinter Printer { get; set; }
/// <summary>
/// The Type of the label
/// </summary>
[DataMember(EmitDefaultValue = false)]
public virtual LabelType Type { get; set; }
[DataMember(EmitDefaultValue = false)]
public virtual ResultLine ResultLine { get; set; }
}
你能發佈完整的異常消息嗎? –
「通信對象System.ServiceModel.Channels.ServiceChannel不能用於通信,因爲它處於Faulted狀態。」 –