次のアプリケーションでは、クラス 'JobManager' のリストを生成します。
List<JobManager>
データベースへのアクセスとリストへの入力は完璧に機能しています。そのようなリストをクライアントに返すのに問題があるようです。
詳細には、私のコードは次のようになります
IService Class
OperationContract(Name = "ReadJobQueue")]
[FaultContract(typeof(FaultException))]
List<JobManager> AccessManager(List<string> status,string process, string dtFrom, string dtTo);
Service : IService
public List<JobManager> AccessManager(List<string> status, string process, string dtFrom, string dtTo)
{
//return 'new List<JobManager>()' does work, without any data being filled.
return new JobBuilder(status, process, dtFrom, dtTo);
}
[DataContract]
public class JobManager
{
List<JobManager> _jobManagerchildren = new List<JobManager>();
[DataMember(IsRequired = true, Order = 0)]
public string Description { get; set; }
[DataMember]
public List<JobManager> JobManagerChildren
{
get { return _jobManagerchildren; }
internal set { _jobManagerchildren = value; }
}
}
internal class JobBuilder : List<JobManager>
{
public JobBuilder(List<string> status, string process, string dtFrom, string dtTo)
: base()
{
DataTable dt = new Database().AccessJobQueue(status, process, dtFrom, dtTo);
foreach (DataRow row in dt.Rows)
{
Add(new JobManager { Description = row[1].ToString(), JobManagerChildren = JobDetail(row[0].ToString()) });
}
}
...
}
JobManager クラスで何か見逃したことがありますか?
エラーコード/例外を編集
System.Net.Sockets.SocketException: System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size , SocketFlags socketFlags) bei System.ServiceModel.Channels.SocketConnection により、既存の接続がリモートホストによって閉じられました.ReadCore(Byte[] buffer, Int 32 offset, Int32 size, TimeSpan timeout, Boolean Closing) --- System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int 32 offset 、Int32 サイズ、TimeSpan タイムアウト、Boolean 終了) System.ServiceModel.Channels.SocketConnection.Read(Byte[] バッファー、Int32 o ffset、Int32 サイズ、TimeSpan タイムアウト) System.ServiceModel.Channels.DelegatingConnection.Read(Byte[]バッファー、Int 32 オフセット、Int32 サイズ、TimeSpan タイムアウト) System.ServiceModel.Channels.ConnectionStream.Read(Byte[] バッファー、Int32 o ffset, Int32 count) System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) bei System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) --- 後で System.Net.Security.NegotiateStream.ProcessRead(Byte [] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) bei System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int 32 count) bei System.ServiceModel.Channels.StreamConnection.Read(Byte[ ] buffer, Int32 offset, Int32 size, TimeSpan timeout) --- Ende der internen Ausnahmestapelüberwachung ---Int32 カウント) System.Net.FixedSizeReader.ReadPacket(Byte[] バッファー、Int32 オフセット、Int32 カウント) System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] バッファー、Int32 オフセット、Int32 カウント、AsyncProtocolRequest asyncRequest) System .Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) --- 後は、System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int 32 count) bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 o ffset、Int32 サイズ、TimeSpan タイムアウト) --- 最終更新日 ---Int32 カウント) System.Net.FixedSizeReader.ReadPacket(Byte[] バッファー、Int32 オフセット、Int32 カウント) System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] バッファー、Int32 オフセット、Int32 カウント、AsyncProtocolRequest asyncRequest) System .Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) --- 後は、System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int 32 count) bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 o ffset、Int32 サイズ、TimeSpan タイムアウト) --- 最終更新日 ---ReadPacket(Byte[] バッファー、Int32 オフセット、Int32 カウント) System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] バッファー、Int32 オフセット、Int32 カウント、AsyncProtocolRequest asyncRequest) System.Net.Security.NegotiateStream.ProcessRead(Byte [] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) --- System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int 32 count) bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 o ffset, Int32 size, TimeSpan timeout) - -- Ende der internen Ausnahmestapelüberwachung ---ReadPacket(Byte[] バッファー、Int32 オフセット、Int32 カウント) System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] バッファー、Int32 オフセット、Int32 カウント、AsyncProtocolRequest asyncRequest) System.Net.Security.NegotiateStream.ProcessRead(Byte [] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) --- System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int 32 count) bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 o ffset, Int32 size, TimeSpan timeout) - -- Ende der internen Ausnahmestapelüberwachung ---NegotiateStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) bei System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) --- 最後に追加機能 --- System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) bei System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int 32 カウント) System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout) --- 最終更新日 ---NegotiateStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) bei System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) --- 最後に追加機能 --- System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) bei System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int 32 カウント) System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout) --- 最終更新日 ---Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) --- System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) System.Net .Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int 32 count) System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout) --- 終了インターン Ausnahmestapelüberwachung ---Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) --- System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offs et, Int32 count, AsyncProtocolRequest asyncRequest) System.Net .Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int 32 count) System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout) --- 終了インターン Ausnahmestapelüberwachung ---Int 32 count) bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 o ffset, Int32 size, TimeSpan timeout) --- 最終更新日 ---Int 32 count) bei System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 o ffset, Int32 size, TimeSpan timeout) --- 最終更新日 ---
サーバー スタック トレース: System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout) System.ServiceModel.Channels.SessionConnectionReader.Receive(TimeSpan timeout) System.ServiceModel. Channels.SynchronizedMessageSource.Receive(TimeSpan timeout) System.ServiceModel.Channels.FramingDuplexSessionChannel.Receive(TimeSpan timeout) System.ServiceModel.Channels.FramingDuplexSessionChannel.TryReceive(TimeSpan timeout, Message& message) System.ServiceModel.Dispatcher.DuplexChannelBinder .Request(Message message, TimeSpan timeout) bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean o neway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) bei System.ServiceModel. Channels.ServiceChannelProxy.InvokeService(IMethodCal lMessage methodCall, ProxyOperationRuntime operation) by System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
[0] で例外が再スローされました。 Shared.IService.AccessManager(List`1 status, String process, String dtFrom, String dtTo) bei WcfSys.Server.Program.Main() in WcfSys.Server \Program.cs:Zeile 66.