cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
510
Views
0
Helpful
1
Replies

AXLSoap.xsd location in AXLAPI.wsdl

tryingtodomyjob
Level 1
Level 1

I am trying to create a Flask app with AXL to manage CUCM 14. I used a simple code:

 

 

    location = 'https://' + user_env.CUCM_LOCATION + ':8443/axl'
    client = Client(user_env.WSDL_PATH, location=location, username=user_env.CUCM_USER, password=user_env.CUCM_PASSWORD)

    result = client.service.listPhone({'name':'SEP%'}, {'name':'', 'model':''})

    for node in result['result']['phone']:
        print(str(node['name']), str(node['model']))

 

 

 I have all the path, name, and password in user_env.

 

 

WSDL_PATH = r"file:\\[DIRECT PATH]\AXLAPI.wsdl"
CUCM_LOCATION = "[CUCM IP ADDRESS]"
CUCM_USER = "USERNAME"
CUCM_PASSWORD = "PASSWORD"

 

 

I keep getting an error saying "urllib.error.URLError: <urlopen error [WinError 2] The system cannot find the file specified: '\\AXLSoap.xsd'>" which I pinpointed to the file AXLAPI.wsdl import location. I changed the path to [DIRECT PATH]\AXLSoap.xsd and still throw the same error but different path.

tryingtodomyjob_0-1691683489835.png

From AXLAPI.wsdl

<?xml version="1.0" encoding="UTF-8"?>
<definitions 
	xmlns="http://schemas.xmlsoap.org/wsdl/" 
	xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
	xmlns:s="http://www.w3.org/2001/XMLSchema" 
	xmlns:s0="http://www.cisco.com/AXLAPIService/" 
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
	xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
	xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
	xmlns:xsd1="http://www.cisco.com/AXL/API/14.0" 
	targetNamespace="http://www.cisco.com/AXLAPIService/">
	
	<import location="AXLSoap.xsd" namespace="http://www.cisco.com/AXL/API/14.0"/>

and I tried 

<?xml version="1.0" encoding="UTF-8"?>
<definitions 
	xmlns="http://schemas.xmlsoap.org/wsdl/" 
	xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
	xmlns:s="http://www.w3.org/2001/XMLSchema" 
	xmlns:s0="http://www.cisco.com/AXLAPIService/" 
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
	xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
	xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
	xmlns:xsd1="http://www.cisco.com/AXL/API/14.0" 
	targetNamespace="http://www.cisco.com/AXLAPIService/">
	
	<import location="[DIRECT_PATH]\AXLSoap.xsd" namespace="http://www.cisco.com/AXL/API/14.0"/>

 

Here is my file structure

 

APP
|
|--axlsqltookit
|
|-- code.py
|
|-- user_env.py

 

 

What path should I put so it can work?

1 Reply 1

davidn#
Cisco Employee
Cisco Employee

I put both the .wsdl and .xsd files in the same directory as my python code and leave the import as is

<import location="AXLSoap.xsd" namespace="http://www.cisco.com/AXL/API/14.0"/>

and that works for me.