在我的WCF Web服务上使用我的webmethods之一时,我收到了这个模糊不清的错误消息。因为这个错误信息没有提供任何解释让我发表我的理论。WCF-“底层连接已关闭:连接意外关闭”
我认为它可能有一些做的返回类型我使用
我这是在Web服务端和客户端refrenced一个类型DLL。在这个DLL中是基类ExceptionMessages。这个类有一个名为DrawingExcepions的孩子。
下面是一些代码:
public class ExceptionMessages
{
public object[] ReturnValue { get; set; }
}
public class DrawingExceptions : ExceptionMessages
{
private List<DrawingException> des = new List<DrawingException>();
}
public class DrawingException
{
public Exception ExceptionMsg { get; set; }
public List<object> Errors { get; set; }
}
的使用代码:
[OperationContract]
ExceptionMessages createNewBom(Bom bom, DrawingFiles dfs);
public ExceptionMessages createNewBOM(Bom bom, DrawingFiles dfs)
{
return insertAssembly(bom, dfs);
}
public DrawingExceptions insertAssembly(Bom bom, DrawingFiles dfs)
{
DrawingExceptions des = new DrawingExceptions();
foreach (DrawingFile d in dfs.drawingFiles)
{
DrawingException temp = insertNewDrawing(bom, d);
if (temp != null)
des.addDrawingException(temp);
if (d.Child != null)
des.addDrawingException(insertAssembly(bom, d.Child));
}
return des;
}
返回到:
ExceptionMessages ems = client.createNewBom(bom, currentDFS);
if (ems is DrawingExceptions) { }
基本上是从的WebMethod返回类型为ExceptionMessages但是我通常会而不是发送孩子班。
我唯一的想法是,这是导致错误的孩子,但据我所知,这应该没有效果。有没有人有任何想法在这里可能会出错?
如果需要任何更多的信息,只问:)
感谢。
这是我在200声望中读到的最有用答案。 – Qqbt 2013-07-10 20:14:01