python-onvif-zeep
python-onvif-zeep copied to clipboard
Delete ns0 from request and response
Good afternoon. I really need to remove prefix from requests my camera swears at him with a 400 error I got to etree.tostring( but inclusive_ns_prefixes=None, does not work :(
Bad
<?xml version='1.0' encoding='utf-8'?> <soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://www.onvif.org/ver10/device/wsdl/GetServices</wsa:Action><wsa:MessageID>urn:uuid:464855d9-4445-48bc-bd9e-88005cc61f22</wsa:MessageID><wsa:To>http://192.168.1.247:80/onvif/device_service</wsa:To><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:UsernameToken><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">************</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">*********</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2022-06-19T17:15:46+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header><soap-env:Body><ns0:GetServices xmlns:ns0="http://www.onvif.org/ver10/device/wsdl"><ns0:IncludeCapability>true</ns0:IncludeCapability></ns0:GetServices></soap-env:Body></soap-env:Envelope>
--->
<env:Body> <env:Fault> <env:Code> <env:Value>env:Receiver</env:Value> <env:Subcode> <env:Value>ter:ActionNotSupported</env:Value> </env:Subcode> </env:Code> <env:Reason> <env:Text xml:lang="en">ActionNotSupported</env:Text> </env:Reason> <env:Detail> <env:Text>The device do NOT support this feature</env:Text> </env:Detail> </env:Fault> </env:Body>
Good
<?xml version='1.0' encoding='utf-8'?> <soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:UsernameToken><wsse:Username>admin</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">************</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">******</wsse:Nonce><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2022-06-19T12:36:12+00:00</wsu:Created></wsse:UsernameToken></wsse:Security></soap-env:Header><soap-env:Body><GetCapabilities xmlns="http://www.onvif.org/ver10/device/wsdl"><Category>All</Category></GetCapabilities></soap-env:Body></soap-env:Envelope>
---->
<env:Body> <tds:GetCapabilitiesResponse> <tds:Capabilities> <tt:Analytics> <tt:XAddr>http://192.168.1.247:80/onvif/analytics_service</tt:XAddr> <tt:RuleSupport>true</tt:RuleSupport> <tt:AnalyticsModuleSupport>true</tt:AnalyticsModuleSupport> </tt:Analytics> <tt:Device> <tt:XAddr>http://192.168.1.247:80/onvif/device_service</tt:XAddr> <tt:Network> <tt:IPFilter>false</tt:IPFilter> <tt:ZeroConfiguration>false</tt:ZeroConfiguration> <tt:IPVersion6>false</tt:IPVersion6> <tt:DynDNS>false</tt:DynDNS> </tt:Network> <tt:System> <tt:DiscoveryResolve>false</tt:DiscoveryResolve> <tt:DiscoveryBye>false</tt:DiscoveryBye> <tt:RemoteDiscovery>true</tt:RemoteDiscovery> <tt:SystemBackup>false</tt:SystemBackup> <tt:SystemLogging>false</tt:SystemLogging> <tt:FirmwareUpgrade>false</tt:FirmwareUpgrade> <tt:SupportedVersions> <tt:Major>2</tt:Major> <tt:Minor>0</tt:Minor> </tt:SupportedVersions> <tt:SupportedVersions> <tt:Major>2</tt:Major> <tt:Minor>10</tt:Minor> </tt:SupportedVersions> <tt:SupportedVersions> <tt:Major>2</tt:Major> <tt:Minor>20</tt:Minor> </tt:SupportedVersions> <tt:SupportedVersions> <tt:Major>2</tt:Major> <tt:Minor>30</tt:Minor> </tt:SupportedVersions> <tt:SupportedVersions> <tt:Major>2</tt:Major> <tt:Minor>40</tt:Minor> </tt:SupportedVersions> <tt:Extension> <tt:HttpFirmwareUpgrade>false</tt:HttpFirmwareUpgrade> <tt:HttpSystemBackup>false</tt:HttpSystemBackup> <tt:HttpSystemLogging>false</tt:HttpSystemLogging> <tt:HttpSupportInformation>false</tt:HttpSupportInformation> </tt:Extension> </tt:System> <tt:IO> <tt:InputConnectors>2</tt:InputConnectors> <tt:RelayOutputs>2</tt:RelayOutputs> </tt:IO> <tt:Security> <tt:TLS1.1>false</tt:TLS1.1> <tt:TLS1.2>false</tt:TLS1.2> <tt:OnboardKeyGeneration>false</tt:OnboardKeyGeneration> <tt:AccessPolicyConfig>false</tt:AccessPolicyConfig> <tt:X.509Token>false</tt:X.509Token> <tt:SAMLToken>false</tt:SAMLToken> <tt:KerberosToken>false</tt:KerberosToken> <tt:RELToken>false</tt:RELToken> <tt:Extension> <tt:TLS1.0>false</tt:TLS1.0> <tt:Extension> <tt:Dot1X>false</tt:Dot1X> <tt:RemoteUserHandling>false</tt:RemoteUserHandling> </tt:Extension> </tt:Extension> </tt:Security> </tt:Device> <tt:Events> <tt:XAddr>http://192.168.1.247:80/onvif/event_service</tt:XAddr> <tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport> <tt:WSPullPointSupport>true</tt:WSPullPointSupport> <tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport> </tt:Events> <tt:Imaging> <tt:XAddr>http://192.168.1.247:80/onvif/imaging_service</tt:XAddr> </tt:Imaging> <tt:Media> <tt:XAddr>http://192.168.1.247:80/onvif/media_service</tt:XAddr> <tt:StreamingCapabilities> <tt:RTPMulticast>true</tt:RTPMulticast> <tt:RTP_TCP>true</tt:RTP_TCP> <tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP> </tt:StreamingCapabilities> </tt:Media> <tt:PTZ> <tt:XAddr>http://192.168.1.247:80/onvif/ptz_service</tt:XAddr> </tt:PTZ> <tt:Extension> <tt:DeviceIO> <tt:XAddr>http://192.168.1.247:80/onvif/deviceio_service</tt:XAddr> <tt:VideoSources>1</tt:VideoSources> <tt:VideoOutputs>0</tt:VideoOutputs> <tt:AudioSources>0</tt:AudioSources> <tt:AudioOutputs>0</tt:AudioOutputs> <tt:RelayOutputs>0</tt:RelayOutputs> </tt:DeviceIO> </tt:Extension> </tds:Capabilities> </tds:GetCapabilitiesResponse> </env:Body> </env:Envelope>
did you manage to solve the problem?