[IronPython] TypeError: bad args to this method

Dino Viehland dinov at exchange.microsoft.com
Fri Jan 20 00:53:02 CET 2006


I believe the problem here is the out param.  Try leaving the sts parameter out of the call and you should get a return value that is a tuple that contains the modified value of the ref & out param.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote .
Sent: Thursday, January 19, 2006 3:33 PM
To: users at lists.ironpython.com
Subject: [IronPython] TypeError: bad args to this method

Hello:
I am trying to connect to a SAP system using IP. A dll  called ProxyIVA.dll 
created under .NET Framework 1.1 facilitates the connection. It works under 
C# without troubles in the next way:

using System;
using System.Web.Services;
using ProxyIVA;

namespace ConsoleApplication1
{
  class Class1
  {
  [STAThread]
  static void Main(string[] args)
  {
    string cs = "ASHOST= 111.11.1.11 SYSNR=00 CLIENT=300 USER=TEST 
PASSWD=x1x1x1x1";
    ProxyIVA.SAPProxy1 PIVA = new ProxyIVA.SAPProxy1(cs);
    ZHRRESNOMTable tIVA = new ZHRRESNOMTable();
    int sts =  0;
    PIVA.Z_Hrpfpa00105("20051231","03005358", out sts, ref tIVA);
   foreach (ZHRRESNOM r in tIVA)
      Console.WriteLine("{0}  {1}", r.Desc2, r.Betrg);
   Console.ReadLine();
   }
}
}


I try to do this in IP with the next results:

>>>^C
:ironpythonconsole
IronPython 1.0.2194 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>>import System
>>>import clr
>>>aso = System.Reflection.Assembly.LoadFrom("C:/Documents and 
>>>Settings/egironas/My Documents/My 
>>>Apps/Py/IronPython-1.0-Beta1/ProxyIVA.dll")
>>>aso1=System.Reflection.Assembly.LoadFrom("C:/WINDOWS/Microsoft.NET/Framework
/v1.1.4322/System.Web.Services.dll")
>>>clr.AddReference(aso)
>>>clr.AddReference(aso1)
>>>from ProxyIVA import *
>>>cs = 'ASHOST= 111.11.1.11 SYSNR=00 CLIENT=300 USER=TEST PASSWD=x1x1x1x1'
>>>PIVA = SAPProxy1(cs)
>>>tIVA = ZHRRESNOMTable()
>>>sts =  0
>>>PIVA.Z_Hrpfpa00105("20051231","03005358", sts, tIVA)
Traceback (most recent call last):
  File , line 0, in input##11
TypeError: bad args to this method <method# Z_Hrpfpa00105 on 
ProxyIVA.SAPProxy1>

>>>

I send you a text dump MSIL information of ProxyIVA.dll:

___[MOD] C:\Documents and Settings\egironas\My Documents\My 
Apps\Py\IronPython-1.0-Beta1\ProxyIVA.dll
   |      M A N I F E S T
   |___[NSP] ProxyIVA
   |   |___[CLS] ProxyIVA.SAPProxy1
   |   |   |     .class public auto ansi serializable beforefieldinit
   |   |   |      extends [SAP.Connector]SAP.Connector.SAPClient
   |   |   |     .custom instance void 
[System.Web.Services]System.Web.Services.WebServiceBindingAttribute::.ctor() 
= ( 01 00 02 00 54 0E 04 4E 61 6D 65 0D 64 75 6D 6D   // ....T..Name.dumm 
...
   |   |   |___[MET] method .ctor : void(string)
   |   |   |___[MET] method .ctor : void(class 
[System]System.ComponentModel.IContainer)
   |   |   |___[MET] method .ctor : void()
   |   |   |___[MET] method Z_Hrpfpa00105 : void(string,string,int32&,class 
ProxyIVA.ZHRRESNOMTable&)
   |   |
   |   |___[CLS] ProxyIVA.ZHRRESNOM
   |   |   |     .class public auto ansi serializable beforefieldinit
   |   |   |      extends [SAP.Connector]SAP.Connector.SAPStructure
   |   |   |     .custom instance void 
[SAP.Connector]SAP.Connector.RfcStructureAttribute::.ctor() = ( 01 00 02 00 
54 0E 08 41 62 61 70 4E 61 6D 65 09   // ....T..AbapName. ...
   |   |   |___[FLD] field _Betrg : private valuetype 
[mscorlib]System.Decimal
   |   |   |___[FLD] field _Desc2 : private string
   |   |   |___[FLD] field _Fpbeg : private string
   |   |   |___[FLD] field _Fpend : private string
   |   |   |___[FLD] field _Lgart : private string
   |   |   |___[FLD] field _Mandt : private string
   |   |   |___[FLD] field _Ocrsn : private string
   |   |   |___[FLD] field _Seqnr : private string
   |   |   |___[MET] method .ctor : void()
   |   |   |___[MET] method get_Betrg : valuetype [mscorlib]System.Decimal()
   |   |   |___[MET] method get_Desc2 : string()
   |   |   |___[MET] method get_Fpbeg : string()
   |   |   |___[MET] method get_Fpend : string()
   |   |   |___[MET] method get_Lgart : string()
   |   |   |___[MET] method get_Mandt : string()
   |   |   |___[MET] method get_Ocrsn : string()
   |   |   |___[MET] method get_Seqnr : string()
   |   |   |___[MET] method set_Betrg : void(valuetype 
[mscorlib]System.Decimal)
   |   |   |___[MET] method set_Desc2 : void(string)
   |   |   |___[MET] method set_Fpbeg : void(string)
   |   |   |___[MET] method set_Fpend : void(string)
   |   |   |___[MET] method set_Lgart : void(string)
   |   |   |___[MET] method set_Mandt : void(string)
   |   |   |___[MET] method set_Ocrsn : void(string)
   |   |   |___[MET] method set_Seqnr : void(string)
   |   |   |___[PTY] prop Betrg : instance valuetype 
[mscorlib]System.Decimal()
   |   |   |___[PTY] prop Desc2 : instance string()
   |   |   |___[PTY] prop Fpbeg : instance string()
   |   |   |___[PTY] prop Fpend : instance string()
   |   |   |___[PTY] prop Lgart : instance string()
   |   |   |___[PTY] prop Mandt : instance string()
   |   |   |___[PTY] prop Ocrsn : instance string()
   |   |   |___[PTY] prop Seqnr : instance string()
   |   |
   |   |___[CLS] ProxyIVA.ZHRRESNOMTable
   |   |   |     .class public auto ansi serializable beforefieldinit
   |   |   |      extends [SAP.Connector]SAP.Connector.SAPTable
   |   |   |     .custom instance void 
[mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 
04 49 74 65 6D 00 00 )                      // ...Item.. ...
   |   |   |___[MET] method .ctor : void()
   |   |   |___[MET] method Add : int32(class ProxyIVA.ZHRRESNOM)
   |   |   |___[MET] method Contains : bool(class ProxyIVA.ZHRRESNOM)
   |   |   |___[MET] method CopyTo : void(class ProxyIVA.ZHRRESNOM[],int32)
   |   |   |___[MET] method CreateNewRow : object()
   |   |   |___[MET] method GetElementType : class [mscorlib]System.Type()
   |   |   |___[MET] method IndexOf : int32(class ProxyIVA.ZHRRESNOM)
   |   |   |___[MET] method Insert : void(int32,class ProxyIVA.ZHRRESNOM)
   |   |   |___[MET] method Remove : void(class ProxyIVA.ZHRRESNOM)
   |   |   |___[MET] method get_Item : class ProxyIVA.ZHRRESNOM(int32)
   |   |   |___[MET] method set_Item : void(int32,class ProxyIVA.ZHRRESNOM)
   |   |   |___[PTY] prop Item : instance class ProxyIVA.ZHRRESNOM(int32)
   |   |
   |


What do you thing the problem is?
Many thanks for your attention and help.
Best regards,

_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger: 
http://messenger.latam.msn.com/

_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list