Forum Discussion

liycheng_55020's avatar
Icon for Nimbostratus rankNimbostratus
Jun 11, 2012

python codfe, always getting <Fault SOAP-ENV:Server: Could not find element by name: user_names>

Code as below:




!/usr/bin/env python


import sys




from SOAPpy import WSDL



wsdl = "/home/liycheng/F5/Management.UserManagement.wsdl.xml"


proxy = WSDL.Proxy(wsdl)















Traceback (most recent call last):


File "", line 1, in


File "/usr/lib/python2.6/site-packages/SOAPpy/", line 453, in __call__


return self.__r_call(*args, **kw)


File "/usr/lib/python2.6/site-packages/SOAPpy/", line 475, in __r_call


self.__hd, self.__ma)


File "/usr/lib/python2.6/site-packages/SOAPpy/", line 389, in __call


raise p




Could not find element by name: user_names>





seems like every method which has any inparams will have the same problem,




they will never find the element which is provided by the string type parameter value.



How can I fix this?

















3 Replies

  • >>> proxy.methods["change_password"].inparams[0].name




    >>> proxy.methods["change_password"].inparams[0].type


    (u'urn:iControl', u'Common.StringSequence')



    if check the inparams using the above code, we can see the inparams' type are u'Common.StringSequence',


    what is this "type"?


    on the API docs,


    this is a alias to "String [] ", so how can I create a object on this tyope and pass it to any method which requires inparams?



  • en, I found




    but my code need deploy on a server which doesn;t have internet connection, always get problem will try to get XML definition fine from some website outside.



  • I do not use SOAPpy and do not know too much about it, but I checked with a colleague and it appears to work like the python interface I use (except the interface I use doesn't absolutely require the parameter name specification, user_names=).

    Put your own address, username, and password in.

    >>> import SOAPpy
    >>> url = "https://username:password@"
    >>> proxy = SOAPpy.SOAPProxy(url, "urn:iControl:Management/UserManagement")
    >>> proxy.get_fullname(user_names=['root'])