473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Type.InvokeMethod not working in remote server object.

Jan
I just started using .NET Remoting.
I have a test system (client) which connects to our device (server)
running XP Embedded.

When my server object is called it uses a library where reflection
(Type.InvokeMethod) is used to dynamically invoke a "command-object" in a
list.
The list of objects are created when server is started (in UI-thread).
Each entry in the command list stores a Type reference, an object reference
and the method name.
The command is invoked like this:

commands[i].ObjectType.InvokeMember(
commands[i].MethodName,
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.InvokeMethod,
null, commands[i].ObjectInstance, pars );

When I call this code from the UI-thread (when pressing a button in user
interface) it works fine, but when called from the server object I get a
MissingMethodException from InvokeMember.

Could it be something about permissions? (which I know next-to-nothing about).

Any ideas?


My remoting code is listed below.

--------------- THE CLIENT ( LibC.dll) ---------------

class TestConnectionRemoting : MarshalByRefObject, ITestOutput, IEventOutput
{
AccessorBase m_Accessor = null;

public override bool Connect()
{
WellKnownClientTypeEntry typeentry =
new WellKnownClientTypeEntry( typeof( AccessorBase ),
"tcp://localhost:399/testinterface" );
typeentry.ApplicationUrl = "tcp://localhost:399/testinterface";
RemotingConfiguration.RegisterWellKnownClientType( typeentry );

BinaryClientFormatterSinkProvider sinkprovider =
new BinaryClientFormatterSinkProvider();
IDictionary properties = new Hashtable();
properties["name"] = "TcpBinary";
properties["port"] = 0;

BinaryServerFormatterSinkProvider provider =
new BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel = TypeFilterLevel.Full;

ChannelServices.RegisterChannel(
new TcpChannel( properties, sinkprovider, provider ), false );

m_Accessor = new AccessorBase();

// deliver event-output interface reference
m_Accessor.SetEventOutputInterface( (IEventOutput) this );

// call remote method where output will be sent back through
// the ITestOutput interface.
m_Accessor.ExecuteCommand( (ITestOutput) this, "login developer" );

return true;
}
Sep 29 '06 #1
0 1459

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Richard Lewis Haggard | last post by:
I know this is a really simple thing but it is not intuitively obvious on how to do this the first time. I've created a remote server which lives in an EXE. This compiles. I've create a client...
2
by: Max | last post by:
When you add an event handler to some object you need to specify the function to call when the event occurs. Suppose there is a class TesterClosed() which is called whenever the Tester is closed....
8
by: Beve Lyni | last post by:
I am running an asp.net project on my localhost and using state server as state management, it has the following code in web.config <sessionState mode="StateServer"...
2
by: Julia | last post by:
Hi, Can a Remote object be a WebService as well? i want to able to connect to a remote object either using .NET remoting and HTTP\SOAP so I wonder if I can create a singleton(statefull)...
0
by: J008 | last post by:
Just looking for some insight as to why the callback "BeginReceiveFromCallback" is not being called in my "Receive" Subroutine below (when I call BeginReceiveFrom). I am trying to read data...
4
by: vncntj | last post by:
I've tested this project locally, by running it http://localhost:1436/Data/gift.aspx and everything is perfect. But if it onto the remote server I get "The type or namespace name could not be...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
0
by: midhunmathe | last post by:
We have a remote server application called from a client application. The server application is a .NET application but built with COM supportability and included as a COM+ service on one system....
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.