Friday, May 28, 2010

Invoking a Method Call Over RIA Services

To invoke a method through RIA Services:

On the server side, declare the method, an decorate it with the [Invoke] annotation. Return types can be simple types or collections.  Not sure if complex types work or not.


public string BuildAdjusterMetricBatch(string users)

    return batch;

On the client side, invoke the method, and pass it a function for the asynchronous Callback:

var context = new Web.Services.MSIClaimContext();
    BatchBuildCompleted, null);

then declare a method for the callback that matches the return type of the Method.

void BatchBuildCompleted(InvokeOperation<string>
    string myValue = invokeOperation.Value;


No comments:

Post a Comment