在python zeep中创建xs:complexType对象

时间:2019-06-18 12:32:05

标签: soap zeep

我正在使用python-onvif-zeep库控制IP摄像机。我需要创建一个PTZVector类型的对象以传递给函数。

我对肥皂不了解,我只需要一些示例代码即可实例化类的对象。

我在文件onvif.xsd中发现以下几行:

    <xs:complexType name="PTZVector">
        <xs:sequence>
            <xs:element name="PanTilt" type="tt:Vector2D" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>Pan and tilt position. The x component corresponds to pan and the y component to tilt.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Zoom" type="tt:Vector1D" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
            A zoom position.
          </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

我需要创建一个如下所示的对象,

   position = PTZVector(x,y,z)
   # call function move in onvif library
   request.Position = position
   ptz.AbsoluteMove(request)

有人可以帮助我吗? 非常感谢!!!

0 个答案:

没有答案
相关问题