New Posts New Posts RSS Feed: Remote Service Method Question
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Remote Service Method Question

 Post Reply Post Reply
Author
BillG View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 05-Dec-2007
Location: Monroe, MI
Posts: 233
Post Options Post Options   Quote BillG Quote  Post ReplyReply Direct Link To This Post Topic: Remote Service Method Question
    Posted: 28-Dec-2010 at 11:44am
I am creating my first Remote Service Method and I want to make sure that I get the first one right as I will have about 5 of these in the app.
 
I have a class named MemberBalanceCalculator. The purpose of the class is to sift through all of a members assessments and payments and figure out a balance owing.
 
The class is located in the LaborWareWeb app and in a directory called RemoteCalls.
 
The method to call in the MemberBalanceCalculator is CalculateAmountOwing.
 
So what is the code going to look like on the client side? How can I pass a complex object to a Remote Service Method. I need to pass a member object or should I pass the string SSN and have the remote service method look up the member and read it into memory?
 
public void CalculateBalance(string ssn)   // what if I want to pass over the member object instead of just the ssn?
{
        string typeName = LaborWareWeb.RemoteCalls.MemberBalanceCalculator, LaborWareWeb";
        string methodName = "CalculateAmountOwing";
 
       var op = Mgr.InvokeServerMethodAsync(typeName, methodName, null, null, ssn);
        op.Completed += (o, args) => {
                    //refresh member object in memory to display the new updated values on the view.
        } 
}
 
Do I need to make any entries in the web config to tell it about this remote service method?
 
Bill
 
 
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 28-Dec-2010 at 1:50pm
Hi BillG;

You can pass a complex object to the InvokeServerMethodAsync method. The last argument that this method takes is params object[] so you can pass any number of object type.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down