我目前正在开发 POC MDS/MDM WCF 服务,并且对验证有疑问。有没有人有调用 MDS web api 来验证 MDS 模型的示例?我知道我必须添加对 MDS 的服务引用才能访问代理,我只是希望有一个使用 api 的简单示例。
问问题
325 次
1 回答
1
//ValidationProcess For an entity
public Collection<ValidationIssue> ValidationProcess(string ModelName, string verName, string EntityName, string memCode)
{
//Instantiate all of request and response objects
ValidationProcessRequest Request = new ValidationProcessRequest();
ValidationProcessResponse Response = new ValidationProcessResponse();
//Instantiate the Criteria and Options objects
Request.ValidationProcessCriteria = new ValidationProcessCriteria();
Request.ValidationProcessOptions = new ValidationProcessOptions();
//Set Model and Version Identifiers - these will be required in all instances
Request.ValidationProcessCriteria.ModelId = new Identifier { Name = ModelName };
Request.ValidationProcessCriteria.VersionId = new Identifier { Name = verName };
Request.ValidationProcessCriteria.EntityId = new Identifier { Name = EntityName };
Request.ValidationProcessCriteria.Members = new Collection<MemberIdentifier>();
Request.ValidationProcessCriteria.Members.Add(new MemberIdentifier { Code = memCode });
//Options can return validation results or trigger the commit of a version (when validation is already successful)
Request.ValidationProcessOptions.ReturnValidationResults = true;
Response = mds_Proxy.ValidationProcess(Request);
return Response.ValidationIssueList;
}
于 2016-01-07T09:51:28.553 回答