New Posts New Posts RSS Feed: InvokeServerMethodAsync
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

InvokeServerMethodAsync

 Post Reply Post Reply
Author
jkattestaart View Drop Down
Newbie
Newbie


Joined: 30-Jul-2010
Location: Netherlands
Posts: 37
Post Options Post Options   Quote jkattestaart Quote  Post ReplyReply Direct Link To This Post Topic: InvokeServerMethodAsync
    Posted: 08-Apr-2013 at 4:48am
Thx i got it working now!
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 07-Apr-2013 at 3:13pm
DevForce requires that RPC methods have a specific signature, so your SendMail method would need to look like this:

[AllowRpc]
public static bool SendMail(IPrincipal principal, EntityManager em, params object[] args)

You can then get the EmailMessage from the args:
var emailMessage = args[0] as EmailMessage;

One other thing to watch out for: the EmailMessage must be a "known" type.

You can find more information here - http://drc.ideablade.com/xwiki/bin/view/Documentation/rsmc-query.
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 06-Apr-2013 at 6:15am
There is no Cocktail wrapper for calling a server method beyond an overload of AsOperationResult to turn the result value of InvokeServerMethodAsync into an OperationResult. I've moved your post to the DevForce forum for help on the mechanics of calling a server method.
Back to Top
jkattestaart View Drop Down
Newbie
Newbie


Joined: 30-Jul-2010
Location: Netherlands
Posts: 37
Post Options Post Options   Quote jkattestaart Quote  Post ReplyReply Direct Link To This Post Posted: 06-Apr-2013 at 2:18am
Hello,

I am using cocktail 1 with Silverlight and i want to send an email from the application. I found the InvokeServerMethodAsync but i'm not sure how to use this. The examples are not clear for me. I want to do something like:

      EntityManager mgr = new AccoBookingEntities();

      // Make async call
      mgr.InvokeServerMethodAsync(new ServerMethodDelegate(EmailMessage.SendMail), InvokeServerMethodAsyncCompleted,_emailMessage);

the server call is:

    [AllowRpc]
    public static bool SendMail(EmailMessage emailMessage)

Is there a cocktail wrapper for this with something like an operationresult an how to use this....

Thx in advance
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down