我刚刚创建的WCF服务出现问题。这是昨天工作,但由于某种原因,它只是停止工作。WCF中的CommunicationException
我的一个WCF方法返回一个实体框架实体的阵列,像这样:
public BranchContactDetail[] GetClosestBranches(string postcode, int howManyBranches)
{
GeoLocation geoLocation = GetLocationFromPostcode(postcode);
Location location = new Location(geoLocation.Latitude, geoLocation.Longitude);
using (BranchDirectoryEntities entities = new BranchDirectoryEntities())
{
var branchesInOrder = entities.BranchContactDetails
.Where(b => b.latitude.HasValue && b.longitude.HasValue)
.OrderBy(b => location.DistanceFrom(b.latitude, b.longitude))
.Take(howManyBranches)
.ToArray();
return branchesInOrder;
}
}
...,正如我说的,这是昨天做工精细。现在我得到了“底层连接已关闭:连接意外关闭。”我在网上搜寻了所有东西,但似乎没有人知道答案。任何人都可以在这个问题上发现什么?
问候,马克
不,我没有返回更多结果。事实上,在测试中,我只会返回更少 - 只有5个实体。 有一点不同的是Branch实体有更多的依赖关系 - 外键等等。可能WCF有这些麻烦吗? – serlingpa 2010-05-20 08:54:13
我没有说它可以连接到结果大小。它可能是连接问题。请阅读上面。 – Incognito 2010-05-20 08:59:18
我已经添加了诊断的东西,因为你建议marc_s,我已经读过正在生产的日志,但我并不聪明。我可以看到异常实际被抛出的位置,但我看不出为什么! !AARGH – serlingpa 2010-05-20 09:06:09