Forum Discussion

liycheng_55020's avatar
liycheng_55020
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)

 

proxy.get_version()

 

proxy.get_fullname('root')

 

 

 

 

 

 

 

 

'BIG-IP_v10.2.2''BIG-IP_v10.2.2'

 

Traceback (most recent call last):

 

File "", line 1, in

 

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

 

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

 

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

 

self.__hd, self.__ma)

 

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

 

raise p

 

SOAPpy.Types.faultType:

 

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

     

    u'user_names'

     

    >>> 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, https://devcentral.f5.com/wiki/iControl.Common.ashx

     

    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

     

    https://devcentral.f5.com/wiki/iControl.SudsPythonExample.ashx

     

     

    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.

     

     

    sigh....
  • 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@10.10.10.10/iControl/iControlPortal.cgi"
    >>> proxy = SOAPpy.SOAPProxy(url, "urn:iControl:Management/UserManagement")
    >>> proxy.get_fullname(user_names=['root'])
    ['root']