Forum Discussion
liycheng_55020
Nimbostratus
Jun 10, 2012python 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
- liycheng_55020
Nimbostratus
>>> 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? - liycheng_55020
Nimbostratus
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.... - Todd_Cromwell_9
Nimbostratus
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']
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects