[IronPython] InvokeMember with three or more parameters.

Pavel Suhotyuk pavel.suhotjuk at gmail.com
Mon Aug 17 10:19:03 CEST 2009


I have Python code:

class Broker ( object ) :

     def validation( self, info, provider_manager ):

     def check( self, payment, payment_manager, provider_manager ):

and try to call methods by this c# code:

operations = scriptEngine.CreateOperations();
var scriptSource = 
scriptCode = scriptSource.Compile();
scriptScope = scriptCode.DefaultScope;
broker = scriptEngine.Execute(string.Format("{0}()","Broker"),scriptScope);

bool validationResult = operations.InvokeMember(broker, "validation", 
paymentInfo, providerManager);

operations.InvokeMember(broker, "check", payment, paymentManager, 

Invoke validation method is success, but invoke check method throws 
NotImplementedException with stack trace:

System.NotImplementedException: Method or operation not implemented.
    в Microsoft.Scripting.Runtime.DynamicOperations.InvokeMember(Object 
obj, String memberName, Boolean ignoreCase, Object[] parameters)
    в Microsoft.Scripting.Hosting.ObjectOperations.InvokeMember(Object 
obj, String memberName, Object[] parameters)

Looks like 2 paramters called correct, but more than 2 throws exception 
in all cases.

Why it happens?

Best regards,
  Suhotjuk Pavel Sergeevich

More information about the Ironpython-users mailing list