对于对该主题感兴趣的人的信息,Jacob Proffitt 的回应看起来像是要走的路。这是 Dynamics GP 文档中的一个狙击手:
catch(SoapException soapErr)
{
// If a validation exception occurred, the logid will be in a child node
if(soapErr.Detail.HasChildNodes == true)
{
// Create a guid for the logid value in the soap exception
Guid guid = new Guid(soapErr.Detail.InnerText);
// Get the validation result object
validationResult = wsDynamicsGP.GetLoggedValidationResultByKey(guid, context);
// Display the number of validation exceptions
MessageBox.Show("Number of validation exceptions: " +
validationResult.Errors.Length.ToString());
}
}
但在我引用的情况下:GetCustomer with an unexisting ID,“soapErr.Detail.HasChildNodes”行是假的,所以它失败了。
网络服务似乎充满了有趣的行为,这将比我预期的要长:(。