これが私の問題です。このようにコールバックを呼び出すと、次のようになります。
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; }
}