469,954 Members | 1,791 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,954 developers. It's quick & easy.

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 GetWebServicesMethods(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 "\tUnexpected 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.getmembers(wsdlObject)

MethodCount = 1

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

ci = wsdlObject.methods[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.getmembers (param)

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

input_parameter_values = ''

for p in ci.getInParameters (): # save the parameters to a
string
input_parameter_values = '%s\t\t Name : %s\n' %
(input_parameter_values, p.name)
input_parameter_values = '%s\t\t Type : %s\n\n' %
(input_parameter_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.ParameterInfo instance at 0x00D4E198>>

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

__module__ = SOAPpy.wstools.WSDLTools
default = None
element_type = 0
name = getLastPromoOrSlottingDateReturn
namespace = None
type = (u'http://www.site.com/offerperf',
u'ArrayOfPerfPromoInfo')
Input Parameters :

Name : in0
Type : ArrayOf_xsd_int
Thanks!

Steve

Dec 6 '06 #1
0 1003

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Harry George | last post: by
reply views Thread by Sameer Deshpande | last post: by
reply views Thread by benboals | last post: by
reply views Thread by Jonathan Morgan | last post: by
1 post views Thread by icius | last post: by
reply views Thread by pion | last post: by
1 post views Thread by neridaj | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.