我正在使用 WCF REST 服务 (4.0) 来公开 JSON API ..但没有让我WebFaultException
工作。
我的方法中有以下内容:
if (!int.TryParse(Id, out idValue))
{
throw new WebFaultException<string>(string.Format(WebExceptionMessages.NotIntegerAsParameter),
HttpStatusCode.BadRequest);
}
当我尝试从提琴手调用服务时,我总是收到相同的错误消息:
我一直在尝试寻找解决方案一段时间......请帮助。