300-835 · Question #43
Refer to the exhibit. Drag and drop the code snippets from the bottom onto the blanks in the code to construct a Python script for Cisco UCM that provisions directory numbers. Not all options are…
The exhibit and code snippet options appear to be missing from your message - the Options: {} field is empty, so I can't tell you exactly which blanks map to which answers. That said, I can give you a thorough conceptual explanation of this exact exam topic so you understand…
Question
Explanation
The exhibit and code snippet options appear to be missing from your message - the Options: {} field is empty, so I can't tell you exactly which blanks map to which answers.
That said, I can give you a thorough conceptual explanation of this exact exam topic so you understand the reasoning, which will help you reconstruct the answer when you have the exhibit in front of you.
Overall Goal
The script uses Cisco's AXL (Administrative XML Layer) API - a SOAP-based web service - to programmatically provision Directory Numbers (DNs) on Cisco UCM. This is the correct approach because:
- UCM's GUI doesn't scale for bulk provisioning
- AXL is Cisco's official programmatic interface for UCM configuration
- Python with the
zeepSOAP library is the standard way to consume AXL
Typical Script Structure and Why Each Step Matters
1. Import libraries
from requests import Session
from requests.auth import HTTPBasicAuth
from zeep import Client
from zeep.transports import Transport
import urllib3
urllib3.disable_warnings()
Why: zeep is a SOAP client. requests handles the HTTP session and authentication. UCM uses a self-signed cert by default, so warnings are suppressed. Skipping this step means no SOAP client and no HTTP session - nothing works.
2. Define connection variables
ucm = '10.10.20.1'
username = 'admin'
password = 'cisco'
Why: AXL is HTTPS-based and requires credentials. These are referenced throughout the script.
3. Build the WSDL URL
wsdl = f'https://{ucm}:8443/axl/schema/current/AXLAPI.wsdl'
Why: The WSDL (Web Services Description Language) file describes every available AXL operation. zeep reads it to know what methods exist (like addLine). Port 8443 is mandatory - AXL never runs on 80/443. If you use the wrong port or wrong path, zeep cannot discover the service.
4. Create an authenticated session
session = Session()
session.verify = False
session.auth = HTTPBasicAuth(username, password)
Why: AXL requires HTTP Basic Auth over TLS. session.verify = False disables SSL certificate validation (common in lab environments). Without auth, every API call returns HTTP 401 Unauthorized.
5. Create the Transport and Client
transport = Transport(session=session)
client = Client(wsdl=wsdl, transport=transport)
Why: The Transport object ties your authenticated session to zeep. The Client parses the WSDL and builds Python-callable stubs for every AXL operation. Order matters - client depends on transport, which depends on session.
6. Call addLine to provision the DN
response = client.service.addLine({
'pattern': '1001',
'routePartitionName': 'Internal_PT',
'description': 'Test DN',
'usage': 'Device'
})
print(response)
Why: addLine is the AXL operation that creates a Directory Number. Key fields:
pattern- the actual DN (e.g.,1001)routePartitionName- required; DNs must belong to a partitionusage- typicallyDevicefor normal lines
If routePartitionName is omitted or wrong, AXL returns a fault. If you call addLine before building the client, Python throws a NameError.
What Goes Wrong If Steps Are Skipped
| Skipped Step | Result |
|---|---|
| No WSDL URL | zeep can't discover AXL methods |
| No auth on session | HTTP 401 on every call |
No session.verify = False | SSL error aborts connection |
| Wrong AXL operation | DN not created; wrong resource modified |
Missing routePartitionName | AXL fault - partition is required |
Memory Tip
Think of it as SWAP-C:
Session → WSDL → Auth → Parameters → Call
Session first, WSDL second, Auth on the session, Parameters in the payload, Call the service method last.
If you can share the actual exhibit image or paste the code snippet options as text, I can map each answer to its exact blank.
Topics
Community Discussion
No community discussion yet for this question.