New Posts New Posts RSS Feed: Invoke calls are getting an error after we updated to 2012
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Invoke calls are getting an error after we updated to 2012

 Post Reply Post Reply
Author
JohnBloom View Drop Down
Groupie
Groupie
Avatar

Joined: 30-Nov-2010
Location: Topeka, KS
Posts: 95
Post Options Post Options   Quote JohnBloom Quote  Post ReplyReply Direct Link To This Post Topic: Invoke calls are getting an error after we updated to 2012
    Posted: 16-Jan-2013 at 2:03pm
We are getting an error when we call InvokeServerMethodAsync:

Type 'System.Object[]' is not known to the serializer.

This happens when we pass in parameters to the object[]. If we pass in null then the invoke call will go through. 

Is there a way to add System.Object[] to the serializer?


-John Bloom
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: 16-Jan-2013 at 3:59pm
There is a way to add known types, but since this was working in DF2010 it's much more likely that the method call isn't quite right.
 
This signature has always been a bit ugly.  Before, you needed to supply a callback and user state, even if null, and then your RPC method arguments.  So something like this:
  manager.InvokeServerMethodAsync("SomeServerType", "SomeMethod", callback, userState, arg1, arg2, ... argN)
 
Now you can instead do:
  await manager.InvokeServerMethodAsync("SomeServerType", "SomeMethod", arg1, arg2, ... argN);
 
If you're supplying a CancellationToken if would come before your arguments.  If you're also referencing the DevForce 2012 Compatibility pack that might confuse things further.
 
 
 
Back to Top
JohnBloom View Drop Down
Groupie
Groupie
Avatar

Joined: 30-Nov-2010
Location: Topeka, KS
Posts: 95
Post Options Post Options   Quote JohnBloom Quote  Post ReplyReply Direct Link To This Post Posted: 17-Jan-2013 at 9:18am
Thanks that was exactly the nudge I needed. Removing the callback and userstate did the trick.
-John Bloom
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down