07-25-2019 09:47 AM
I am using Python Zeep (https://pypi.org/project/zeep/)
1. Version of Zeep: latest stable version on pypi, 3.4.0
2. latest AXLAPI.wsdl (https://drive.google.com/file/d/1ev-EAUT4LjHTVdH6durDMAB413sCRe_I/view?usp=sharing)
3. Runnable example: https://drive.google.com/file/d/1MowHDcSvfhIpWRyU5DOA8QPBguGKr_dc/view?usp=sharing
I'm probably just doing the syntax wrong, but what's odd is passing a uuid that doesn't exist at least returns something like "line not found", where as passing the actual uuid results in a bunch of errors.
Traceback (most recent call last):
File "C:/Users/jmcclain/.PyCharm2019.1/config/scratches/scratch.py", line 61, in <module>
resp4 = service.getLine(uuid=dp.lines.line[0].dirn.uuid)
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\proxy.py", line 45, in __call__
kwargs,
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\wsdl\bindings\soap.py", line 130, in send
return self.process_reply(client, operation_obj, response)
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\wsdl\bindings\soap.py", line 197, in process_reply
result = operation.process_reply(doc)
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\wsdl\bindings\soap.py", line 396, in process_reply
return self.output.deserialize(envelope)
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\wsdl\messages\soap.py", line 94, in deserialize
body_result = self._deserialize_body(body)
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\wsdl\messages\soap.py", line 425, in _deserialize_body
result = self.body.parse(xmlelement, self.wsdl.types, context=context)
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\elements\element.py", line 130, in parse
schema_type=self.type,
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\types\complex.py", line 194, in parse_xmlelement
elements, schema, name, context=context
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\elements\indicators.py", line 609, in parse_xmlelements
xmlelements, schema, name, context=context
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\elements\element.py", line 176, in parse_xmlelements
item = self.parse(xmlelement, schema, allow_none=True, context=context)
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\elements\element.py", line 130, in parse
schema_type=self.type,
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\types\complex.py", line 194, in parse_xmlelement
elements, schema, name, context=context
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\elements\indicators.py", line 609, in parse_xmlelements
xmlelements, schema, name, context=context
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\elements\element.py", line 176, in parse_xmlelements
item = self.parse(xmlelement, schema, allow_none=True, context=context)
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\elements\element.py", line 130, in parse
schema_type=self.type,
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\types\complex.py", line 194, in parse_xmlelement
elements, schema, name, context=context
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\elements\indicators.py", line 609, in parse_xmlelements
xmlelements, schema, name, context=context
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\elements\element.py", line 176, in parse_xmlelements
item = self.parse(xmlelement, schema, allow_none=True, context=context)
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\elements\element.py", line 130, in parse
schema_type=self.type,
File "C:\Users\jmcclain\PycharmProjects\CUCM\venv\lib\site-packages\zeep\xsd\types\complex.py", line 204, in parse_xmlelement
raise XMLParseError("Unexpected element %r" % elements[0].tag)
zeep.exceptions.XMLParseError: Unexpected element 'isAnonymous'
Solved! Go to Solution.
07-29-2019 12:29 PM
It appears that there is a mismatch between the 12.5 AXL schema and the implementation (what is actually returned.)
The AXL schema shows the <getLine> response object <RLine> having <externalPresentationInfo> element as either (xsd:choice) a <presentationInfo> complex type or a <isAnonymous> element, however the response returned by the implementation includes both. This breaks applications attempting to validate/parse the response based on the schema.
Schema (part of <RLINE>):
<xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationInfo"> <xsd:complexType> <xsd:choice minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="presentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationNumber" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationName" type="axlapi:String50"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element maxOccurs="1" minOccurs="0" name="isAnonymous" type="axlapi:boolean"/> </xsd:choice> </xsd:complexType> </xsd:element>
Actual response:
<externalPresentationInfo> <presentationInfo> <externalPresentationNumber/> <externalPresentationName/> </presentationInfo> <isAnonymous>f</isAnonymous> </externalPresentationInfo>
I've created a defect to track this issue: CSCvq70670
You can possibly work around the problem by manually editing the AXLSOAP.xsd file, changing <xsd:choice> to <xsd:sequence> (two places). Note, I also had to move the <isAnonymous> element down in order to match the implementation order to avoid another Zeep error.
Patched AXLSOAP.xsd (under RLINE):
<xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="presentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationNumber" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationName" type="axlapi:String50"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element maxOccurs="1" minOccurs="0" name="isAnonymous" type="axlapi:boolean"/> </xsd:sequence> </xsd:complexType> </xsd:element>
07-29-2019 12:29 PM
It appears that there is a mismatch between the 12.5 AXL schema and the implementation (what is actually returned.)
The AXL schema shows the <getLine> response object <RLine> having <externalPresentationInfo> element as either (xsd:choice) a <presentationInfo> complex type or a <isAnonymous> element, however the response returned by the implementation includes both. This breaks applications attempting to validate/parse the response based on the schema.
Schema (part of <RLINE>):
<xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationInfo"> <xsd:complexType> <xsd:choice minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="presentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationNumber" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationName" type="axlapi:String50"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element maxOccurs="1" minOccurs="0" name="isAnonymous" type="axlapi:boolean"/> </xsd:choice> </xsd:complexType> </xsd:element>
Actual response:
<externalPresentationInfo> <presentationInfo> <externalPresentationNumber/> <externalPresentationName/> </presentationInfo> <isAnonymous>f</isAnonymous> </externalPresentationInfo>
I've created a defect to track this issue: CSCvq70670
You can possibly work around the problem by manually editing the AXLSOAP.xsd file, changing <xsd:choice> to <xsd:sequence> (two places). Note, I also had to move the <isAnonymous> element down in order to match the implementation order to avoid another Zeep error.
Patched AXLSOAP.xsd (under RLINE):
<xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="presentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationNumber" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationName" type="axlapi:String50"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element maxOccurs="1" minOccurs="0" name="isAnonymous" type="axlapi:boolean"/> </xsd:sequence> </xsd:complexType> </xsd:element>
07-29-2019 12:44 PM
Re <listLine>, it looks like searching by uuid is not one of the available options for <searchCriteria>:
<xsd:element name="searchCriteria"> <xsd:annotation> <xsd:documentation>At least one element under searchCriteria has to be mentioned</xsd:documentation> </xsd:annotation> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs="0" name="pattern" type="xsd:string"/> <xsd:element minOccurs="0" name="description" type="xsd:string"/> <xsd:element minOccurs="0" name="usage" type="xsd:string"> <xsd:annotation> <xsd:documentation>For Intercom DN and Intercom Translation patterns the usage tag value needs to be specified explicitly as Device Intercom and Translation Intercom respectively. For all other patterns it is a Read-only tag.</xsd:documentation> </xsd:annotation> </xsd:element> <xsd:element minOccurs="0" name="routePartitionName" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element>
07-29-2019 12:50 PM
10-07-2019 12:48 PM
This same issue exists with getSipTrunk which uses RSipTrunk as defined inthe axlsoap.xsd file.
I changed "choice" to "sequence" and moved "isanonymous" after "presentationInfo". I can now perform the getsiptrunk. Thanks for the clues in the above post.
Here's the element clip from the working axlsoap.xsd:
<xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="presentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationNumber" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationName" type="axlapi:String50"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element maxOccurs="1" minOccurs="0" name="isAnonymous" type="axlapi:boolean"/> </xsd:sequence> </xsd:complexType> </xsd:element>
11-25-2021 02:39 AM
Hi,
I had the same issue for getLine and it was fixed with the workaround proposed. thanks.
But, I continue with the same problem for addLine. I have modify the <XLine> from:
<xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationInfo" nillable="false"> <xsd:complexType> <xsd:choice minOccurs="1"> <xsd:element maxOccurs="1" minOccurs="1" name="isAnonymous" nillable="false" type="axlapi:boolean"/> <xsd:element maxOccurs="1" minOccurs="1" name="presentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationNumber" nillable="true" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationName" nillable="true" type="axlapi:String50"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element>
to:
<xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="1"> <xsd:element maxOccurs="1" minOccurs="1" name="presentationInfo"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationNumber" type="xsd:string"/> <xsd:element maxOccurs="1" minOccurs="0" name="externalPresentationName" type="axlapi:String50"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element maxOccurs="1" minOccurs="1" name="isAnonymous" type="axlapi:boolean"/> </xsd:sequence> </xsd:complexType> </xsd:element>
thanks for your help by advance.
regards,
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