Je travaille avec onvif wsdls.Comment insérer un élément dans une requête générée?
Et je veux envoyer la demande "S'abonner" avec le filtre. Le filtre contient l'expression de rubrique. Demande comme ceci:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:b="http://docs.oasis-open.org/wsn/b-2"
xmlns:add="http://www.w3.org/2005/08/addressing">
<soap:Header/>
<soap:Body>
<b:Subscribe>
<b:ConsumerReference>
<add:Address>http://10.1.50.11:8000</add:Address>
<!--Optional:-->
<add:ReferenceParameters>
<!--You may enter ANY elements at this point-->
</add:ReferenceParameters>
<!--Optional:-->
<add:Metadata>
<!--You may enter ANY elements at this point-->
</add:Metadata>
<!--You may enter ANY elements at this point-->
</b:ConsumerReference>
<!--Optional:-->
<b:Filter>
<!--You may enter ANY elements at this point-->
<wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet" xmlns:o2kvmd="http://www.o2kvmd.com/onvif-sdk/v1" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tns1="http://www.onvif.org/ver10/topics">o2kvmd:Tele//.</wsnt:TopicExpression>
</b:Filter>
<!--Optional:-->
<!--type: AbsoluteOrRelativeTimeType-->
<b:InitialTerminationTime>PT60S</b:InitialTerminationTime>
<!--Optional:-->
<b:SubscriptionPolicy>
<!--You may enter ANY elements at this point-->
</b:SubscriptionPolicy>
<!--You may enter ANY elements at this point-->
</b:Subscribe>
Dans le code python i peut envoyer la demande sans filtre. Code comme ceci:
notification = mycam.create_notification_service()
subscribe = notification.create_type('Subscribe')
obj = subscribe(ConsumerReference='http://10.1.50.11:8000',InitialTerminationTime='PT60S', Filter={})
notification.Subscribe(obj)
Et demande envoyée avec succès
Mais je ne sais pas comment je peux insérer TopicExpression dans le filtre comme dans la demande ci-dessus. Dites-moi s'il vous plaît, comment je peux faire ceci?