locked
EntityMembersGet() in SQL 2012 RRS feed

  • Question

  • 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

    Wednesday, December 5, 2012 10:52 AM

Answers

  • 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;
            }
        }

    • Proposed as answer by Elvis Long Tuesday, December 11, 2012 9:43 AM
    • Marked as answer by Elvis Long Monday, December 17, 2012 1:24 AM
    Wednesday, December 5, 2012 12:26 PM

All replies

  • 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;
            }
        }

    • Proposed as answer by Elvis Long Tuesday, December 11, 2012 9:43 AM
    • Marked as answer by Elvis Long Monday, December 17, 2012 1:24 AM
    Wednesday, December 5, 2012 12:26 PM
  • Hi Raj,

    How about this issue?

    Regards,


    Elvis Long
    TechNet Community Support

    Tuesday, December 11, 2012 10:03 AM