cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1246
Views
10
Helpful
2
Replies

CUCM AXL update_phone fails

mserwon
Level 1
Level 1

I have a phone SEPF04A02EEED5B that I am trying to update using AXL.  I am starting simply by using the githubCiscoDevNet/axl-python-zeep-samples as much as possible and just trying to update the phone description.  However when I run the python script I get the following typeerror: choice elements only work with keyword arguments.

 

Traceback (most recent call last):
File "D:\Users\mserwon\scripts\axl_update_phone.py", line 110, in <module>
resp = service.updatePhone( phone )
File "D:\Users\mserwon\AppData\Local\Programs\Python\Python310\lib\site-packages\zeep\proxy.py", line 40, in __call__
return self._proxy._binding.send(
File "D:\Users\mserwon\AppData\Local\Programs\Python\Python310\lib\site-packages\zeep\wsdl\bindings\soap.py", line 118, in send
envelope, http_headers = self._create(
File "D:\Users\mserwon\AppData\Local\Programs\Python\Python310\lib\site-packages\zeep\wsdl\bindings\soap.py", line 68, in _create
serialized = operation_obj.create(*args, **kwargs)
File "D:\Users\mserwon\AppData\Local\Programs\Python\Python310\lib\site-packages\zeep\wsdl\definitions.py", line 215, in create
return self.input.serialize(*args, **kwargs)
File "D:\Users\mserwon\AppData\Local\Programs\Python\Python310\lib\site-packages\zeep\wsdl\messages\soap.py", line 68, in serialize
body_value = self.body(*args, **kwargs)
File "D:\Users\mserwon\AppData\Local\Programs\Python\Python310\lib\site-packages\zeep\xsd\elements\element.py", line 57, in __call__
instance = self.type(*args, **kwargs)
File "D:\Users\mserwon\AppData\Local\Programs\Python\Python310\lib\site-packages\zeep\xsd\types\complex.py", line 49, in __call__
return self._value_class(*args, **kwargs)
File "D:\Users\mserwon\AppData\Local\Programs\Python\Python310\lib\site-packages\zeep\xsd\valueobjects.py", line 95, in __init__
items = _process_signature(self._xsd_type, args, kwargs)
File "D:\Users\mserwon\AppData\Local\Programs\Python\Python310\lib\site-packages\zeep\xsd\valueobjects.py", line 185, in _process_signature
values, args, index = element.parse_args(args, index)
File "D:\Users\mserwon\AppData\Local\Programs\Python\Python310\lib\site-packages\zeep\xsd\elements\indicators.py", line 129, in parse_args
raise TypeError("Choice elements only work with keyword arguments")
TypeError: Choice elements only work with keyword arguments

 

I enclosed the python code.

 

 

 

1 Accepted Solution

Accepted Solutions

npetrele
Cisco Employee
Cisco Employee

Try this instead:

 

resp = service.updatePhone( name = 'SEPF04A02EEED5B', description = 'Test axl description' )

 

add operations can use JSON, but update operations need a choice element (name, in this case).

 

EDITED TO ADD:  'SEPF04A02EEED5B', -- in my browser that looks like a semicolon. It's not. It's an end quote and a comma.

View solution in original post

2 Replies 2

npetrele
Cisco Employee
Cisco Employee

Try this instead:

 

resp = service.updatePhone( name = 'SEPF04A02EEED5B', description = 'Test axl description' )

 

add operations can use JSON, but update operations need a choice element (name, in this case).

 

EDITED TO ADD:  'SEPF04A02EEED5B', -- in my browser that looks like a semicolon. It's not. It's an end quote and a comma.

Thanks very much it worked just as you detailed.