Answered EntityMembersGet() in SQL 2012

  • Wednesday, December 05, 2012 10:52 AM
     
     

    I have written a method to consume  EntityMembersGet() web method in MDS webservices. This code works perfectly in SQL Server 2008 R2 MDS where as in SQL Server 2012 MDS, no records are returned. I am specifying the model name and entity name and version id.

     

    Regards,

    Raj

All Replies

  • Wednesday, December 05, 2012 12:26 PM
     
     Answered

    The response object has operationalresult. Put a break point and check if there are any errors in the operational result. Sample code is as below.

    response = service.EntityMembersGet(request);
    HandleResponseResults(response.OperationResult);

    The code for HandleResponseResults is as below: -

    public void HandleResponseResults(OperationResult result)
        {
            string errorMessage = string.Empty;

            if (result.Errors.Count > 0)
            {
                foreach (Error anError in result.Errors)
                {
                    errorMessage += "Operation Error: " + anError.Code + ":" + anError.Description + "\n";
                }
                // Throw an exception.
                Exception exception = new Exception(errorMessage);
                throw exception;
            }
        }

  • Tuesday, December 11, 2012 10:03 AM
    Moderator
     
     

    Hi Raj,

    How about this issue?

    Regards,


    Elvis Long
    TechNet Community Support