0

I'm currently working on a POC MDS/MDM WCF service and have a question regarding validation. Does anyone have an example of calling the MDS web api to kick of validating the MDS model? I know i have to add a service reference to MDS in order to gain access to the proxies, i was just hoping for a simple example of using the api.

https://msdn.microsoft.com/en-us/library/microsoft.masterdataservices.serviceclient.validationprocess(v=sql.110).aspx

1 Answers1

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;

    }
UselessSQL
  • 46
  • 2
  • This above example and many more can be found in the "Master Data Services" book by Tyler Graham found here: http://www.mdsuser.com/ – UselessSQL Jan 07 '16 at 09:53