首页 > 解决方案 > zeep:没有可用于命名空间“urn:WebdialerSoap”的架构

问题描述

我正在尝试从 Cisco CUCM 10.5.2(即getProfileSoap)获取与指定最终用户关联的设备列表。我正在使用 zeep 来处理请求和响应。我这样称呼这样的端点:

service.getProfileSoap(in0={"userID": "foo", "password": "bar"}, in1="just_a_username")

但我得到:

zeep.exceptions.NamespaceError:无法解析类型 {urn:WebdialerSoap}WDDeviceInfo。没有可用于命名空间“urn:WebdialerSoap”的架构。

响应如下:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <ns1:getProfileSoapResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:WD70">
         <getProfileSoapReturn href="#id0"/>
      </ns1:getProfileSoapResponse>
      <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:GetConfigResponse" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:WD70">
         <description xsi:type="xsd:string">Success</description>
         <deviceInfoList soapenc:arrayType="ns3:WDDeviceInfo[1]" xsi:type="soapenc:Array" xmlns:ns3="urn:WebdialerSoap">
            <item href="#id1"/>
         </deviceInfoList>
         <responseCode href="#id2"/>
      </multiRef>
      <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
      <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:WDDeviceInfo" xmlns:ns4="urn:WebdialerSoap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
         <deviceName xsi:type="xsd:string">IPCMRAEU5UCM5X7</deviceName>
         <lines soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
            <item xsi:type="xsd:string">1251 ; no partition</item>
         </lines>
      </multiRef>
   </soapenv:Body>
</soapenv:Envelope>

它看起来像是 XML 模式的问题。有解决方法吗?

标签: pythonxmlsoapxml-namespaceszeep

解决方案


推荐阅读