04-16-2018 08:25 AM
Hi Cisco folks,
The schema definition for XRemoteDestination includes the follows:
<xsd:element maxOccurs="1" minOccurs="1" name="remoteDestinationProfileName" nillable="true" type="axlapi:XFkType">
and
<xsd:element maxOccurs="1" minOccurs="1" name="dualModeDeviceName" nillable="true" type="axlapi:XFkType"/>
This is annotated as such:
<xsd:annotation>
<xsd:documentation>If you are giving value to dualModeDeviceName then you can't give value to remoteDestinationProfileName,viceversa</xsd:documentation>
</xsd:annotation>
Surely this is wrong? Why is minOccurs enforced for both?
When I'm using python-zeep, its enforcing the minOccurs definitions, and putting this on the wire:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Body>
<ns0:addRemoteDestination xmlns:ns0="http://www.cisco.com/AXL/API/11.5">
<remoteDestination>
<name>Jonathan RD</name>
<destination>6666</destination>
<answerTooSoonTimer>1500</answerTooSoonTimer>
<answerTooLateTimer>19000</answerTooLateTimer>
<delayBeforeRingingCell>4000</delayBeforeRingingCell>
<ownerUserId>jonathan.els</ownerUserId>
<enableUnifiedMobility>true</enableUnifiedMobility>
<remoteDestinationProfileName>RDPJONATHAN</remoteDestinationProfileName>
<dualModeDeviceName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<isMobilePhone>true</isMobilePhone>
<enableMobileConnect>true</enableMobileConnect>
</remoteDestination>
</ns0:addRemoteDestination>
</soap-env:Body>
</soap-env:Envelope>
AXL is interpreting the blank as having both attributes requested, and then barks back with:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>At a time you can associate Remote Destination Profile either with Remote device or dual mode device</faultstring>
<detail>
<axlError>
<axlcode>5003</axlcode>
<axlmessage>At a time you can associate Remote Destination Profile either with Remote device or dual mode device</axlmessage>
<request>addRemoteDestination</request>
</axlError>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
interpreting
Solved! Go to Solution.
04-17-2018 07:31 PM
This is clearly a bug. I've opened an escalation with the BU. Should get a Bug ID for you soon.
04-16-2018 08:26 AM
I have a workaround to manually edit the minOccurs settings in the xsd file. Obviously that sucks though. I can go to the library maintainer, but really, the problem is with the schema itself?
04-16-2018 02:56 PM
here is a sample in zeep:
# -*- coding: utf-8 -*-
from zeep import Client
from zeep.cache import SqliteCache
from zeep.transports import Transport
from zeep.exceptions import Fault
from zeep.plugins import HistoryPlugin
from requests import Session
from requests.auth import HTTPBasicAuth
from urllib3 import disable_warnings
from urllib3.exceptions import InsecureRequestWarning
from lxml import etree
disable_warnings(InsecureRequestWarning)
USERNAME = 'administrator'
PASSWORD = 'ciscopsdt'
FQDN = '10.10.20.1'
WSDL = 'file://C://Users//jonathan.els//develop//pvt-repos//UCToolkit//schema//current//AXLAPI.wsdl'
BINDING_NAME = "{http://www.cisco.com/AXLAPIService/}AXLAPIBinding"
ADDRESS = "https://{fqdn}:8443/axl/".format(fqdn=FQDN)
def main():
session = Session()
session.verify = False
session.auth = HTTPBasicAuth(USERNAME, PASSWORD)
transport = Transport(cache=SqliteCache(), session=session, timeout=60)
history = HistoryPlugin()
client = Client(wsdl=WSDL, transport=transport, plugins=[history])
axl = client.create_service(BINDING_NAME, ADDRESS)
kwargs = {
"name": "oh dear it failed",
"destination": "123456",
"ownerUserId": "jonathan.els",
"enableUnifiedMobility": "true",
"enableMobileConnect": "true",
"isMobilePhone": "true",
"remoteDestinationProfileName": "RDPJONATHAN",
"lineAssociations": None
}
try:
axl.addRemoteDestination(remoteDestination=kwargs)
except Fault:
for hist in [history.last_sent, history.last_received]:
print(etree.tostring(hist["envelope"], encoding="unicode", pretty_print=True))
if __name__ == '__main__':
main()
here is the request and output with subsequent error:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Body>
<ns0:addRemoteDestination xmlns:ns0="http://www.cisco.com/AXL/API/11.5">
<remoteDestination>
<name>oh dear it failed</name>
<destination>123456</destination>
<answerTooSoonTimer>1500</answerTooSoonTimer>
<answerTooLateTimer>19000</answerTooLateTimer>
<delayBeforeRingingCell>4000</delayBeforeRingingCell>
<ownerUserId>jonathan.els</ownerUserId>
<enableUnifiedMobility>true</enableUnifiedMobility>
<remoteDestinationProfileName>RDPJONATHAN</remoteDestinationProfileName>
<dualModeDeviceName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<isMobilePhone>true</isMobilePhone>
<enableMobileConnect>true</enableMobileConnect>
</remoteDestination>
</ns0:addRemoteDestination>
</soap-env:Body>
</soap-env:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>At a time you can associate Remote Destination Profile either with Remote device or dual mode device</faultstring>
<detail>
<axlError>
<axlcode>5003</axlcode>
<axlmessage>At a time you can associate Remote Destination Profile either with Remote device or dual mode device</axlmessage>
<request>addRemoteDestination</request>
</axlError>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
If I edit the AXL schema and remote the minOccurs requirement, it works:
In:
<xsd:complexType name="XRemoteDestination">
I set to zero for both:
<xsd:element maxOccurs="1" minOccurs="0" name="remoteDestinationProfileName" nillable="true" type="axlapi:XFkTyp
<xsd:element maxOccurs="1" minOccurs="0" name="dualModeDeviceName" nillable="true" type="axlapi:XFkType"/>
04-17-2018 07:31 PM
This is clearly a bug. I've opened an escalation with the BU. Should get a Bug ID for you soon.
04-24-2018 12:42 AM
Bug filed - CSCvj13354
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide