cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1561
Views
5
Helpful
2
Replies

Callmanager 11.5 & AXL Python - addCss

rene.smole
Level 1
Level 1

Dear Cisco community,

 

currently i work on a simple pyhton script to add one Calling Search Space with a few partitions.

My testing enviroment:

  • Pyhton 3.7 (Windows)
  • zeep module (python to soap)
  • CuCM 11.5 SU5

 

If i try to send the following code, my pyhton / zeep module send every time only the last routePartition member in the xml to my cucm:

Spoiler
try:
resp = service.addCss(css={
'name': 'at-steyr-device',
'description': 'at-steyr-device',
'members': {
'member': {
'index': 1,
'routePartitionName': 'at-steyr-emergency-out',
},
'member': {
'index': 2,
'routePartitionName': 'global-internal',
},
},
})
print(resp)
except Fault:
show_history()

The follwing code is send by zeep/pyhton/soap to my cucm 11.5

Spoiler
<?xml version='1.0' encoding='utf-8'?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Body>
<ns0:addCss xmlns:ns0="http://www.cisco.com/AXL/API/11.5">

<css>
<description>at-steyr-device</description>
<members>
<member>
<routePartitionName>at-pstn-out</routePartitionName>
<index>4</index>
</member>
</members>
<name>at-steyr-device</name>
</css>
</ns0:addCss>
</soap-env:Body>
</soap-env:Envelope>
zeep.transports: HTTP Response from https://10.20.20.10:8443/axl/ (status: 200):
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:addCssResponse xmlns:ns="http://www.cisco.com/AXL/API/11.5"><return>{6FBABB9D-95A7-89AC-5400-9CF1C4CA3CD1}</return></ns:addCssResponse></soapenv:Body></soapenv:Envelope>

 

So the problem is, no matter how much partiotions / members are added, it will be always added only the last member in the code.

 

I´ve try it with the uuid, no change!

 

I hope, anyone has an idea :) -thank you!

Best regards,

rene

 
1 Accepted Solution

Accepted Solutions

dstaudt
Cisco Employee
Cisco Employee

Got this working on my 11.5 system and added a sample demonstrating how it works:

https://github.com/CiscoDevNet/axl-python-zeep-sample

The main trick you are running into seems to be:

 

 

  • Elements which contain a list, such as:

    <members>
        <member>
            <subElement1/>
            <subElement2/>
        </member>
        <member>
            <subElement1/>
            <subElement2/>
        </member>        
    </members>

    are represented a little differently than expected by Zeep. Note that <member> becomes an array, not <members>:

    { 
        members: {
            member: [
                {
                    "subElement1": None,
                    "subElement2": None
                },
                                {
                    "subElement1": None,
                    "subElement2": None
                }
            ]
        }
    }

 

View solution in original post

2 Replies 2

dstaudt
Cisco Employee
Cisco Employee

Got this working on my 11.5 system and added a sample demonstrating how it works:

https://github.com/CiscoDevNet/axl-python-zeep-sample

The main trick you are running into seems to be:

 

 

  • Elements which contain a list, such as:

    <members>
        <member>
            <subElement1/>
            <subElement2/>
        </member>
        <member>
            <subElement1/>
            <subElement2/>
        </member>        
    </members>

    are represented a little differently than expected by Zeep. Note that <member> becomes an array, not <members>:

    { 
        members: {
            member: [
                {
                    "subElement1": None,
                    "subElement2": None
                },
                                {
                    "subElement1": None,
                    "subElement2": None
                }
            ]
        }
    }

 

Hy :)

realy cool, this solved my problem.
Thank you very much!

best regards