SOAPpy - Getting info about the __init__ method

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

    #1

    SOAPpy - Getting info about the __init__ method

    Hi All,

    I have a Python script that uses SOAPpy and I'm outputting all of the
    methods and info about the parameters... I'm having trouble getting
    information out of the __init__ parameter.


    My code :

    from SOAPpy import WSDL


    def GetWebServicesM ethods(url):
    # requires import :
    #from SOAPpy import WSDL

    # just use the path to the wsdl of your choice

    full_url = url + '?WSDL'

    try:

    wsdlObject = WSDL.Proxy(full _url)

    except Exception:
    print "\n\nError in Getting WebServices Methods for : %s\n\n" %
    full_url
    print "\tUnexpect ed error : %s \n \t\t\t %s " %
    (sys.exc_info()[0], sys.exc_info()[1])
    print
    return

    print '\nAvailable Methods for : %s\n\n' % (url)

    # print 'wsdlObject Raw : ', wsdlObject

    # print inspect.getmemb ers(wsdlObject)

    MethodCount = 1

    for method in wsdlObject.meth ods.keys() :
    print '\t %d) %s\n' % (MethodCount, method)

    ci = wsdlObject.meth ods[method] # get the details of the current
    method

    for param in ci.outparams :
    # list of the function and type depending of the wsdl...

    AllParams = inspect.getmemb ers (param)

    for SubParam in AllParams:
    ParamName,Param Value = SubParam
    # print '%15s = %s' % SubParam
    if ParamName == '__init__':
    print 'init_info = ', ParamValue
    else:
    print '%15s = %s' % (ParamName,Para mValue)

    input_parameter _values = ''

    for p in ci.getInParamet ers (): # save the parameters to a
    string
    input_parameter _values = '%s\t\t Name : %s\n' %
    (input_paramete r_values, p.name)
    input_parameter _values = '%s\t\t Type : %s\n\n' %
    (input_paramete r_values, p.type[1])

    if input_parameter _values: # print only when there are
    parameters
    print '\n\n\t\tInput Parameters : \n'
    print input_parameter _values

    print
    print
    MethodCount = MethodCount + 1


    Output :


    1) getDate

    __doc__ = A ParameterInfo object captures parameter binding
    information.

    init_info = <bound method ParameterInfo._ _init__ of
    <SOAPpy.wstools .WSDLTools.Para meterInfo instance at 0x00D4E198>>

    *** How do I get the info out of the __init__ structure ???

    __module__ = SOAPpy.wstools. WSDLTools
    default = None
    element_type = 0
    name = getLastPromoOrS lottingDateRetu rn
    namespace = None
    type = (u'http://www.site.com/offerperf',
    u'ArrayOfPerfPr omoInfo')


    Input Parameters :

    Name : in0
    Type : ArrayOf_xsd_int


    Thanks!

    Steve

Working...