You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何生成GetSystemDateAndTime XML?附相关C#初始化代码

Generate GetSystemDateAndTime XML for ONVIF (SOAP 1.2, No WS-Addressing)

Hey there! Looking at your initialization code, it’s clear you’re setting up communication with an ONVIF camera using a SOAP 1.2 binding that skips WS-Addressing. Perfect—here’s the exact GetSystemDateAndTime XML request that fits that setup, plus a quick breakdown of what each part does:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
               xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
  <soap:Body>
    <tds:GetSystemDateAndTime />
  </soap:Body>
</soap:Envelope>

Key Details to Match Your Code:

  • SOAP 1.2 Compliance: Uses the http://www.w3.org/2003/05/soap-envelope namespace, which aligns with your EnvelopeVersion.Soap12 setting.
  • No WS-Addressing: No <soap:Header> elements with addressing info, since you specified AddressingVersion.None in your binding.
  • ONVIF Device Namespace: The tds prefix maps to the ONVIF device service namespace (http://www.onvif.org/ver10/device/wsdl), which is required for the GetSystemDateAndTime operation.

Quick Tip for Your C# Code:

If you want to build this request programmatically instead of using raw XML, you can leverage your existing binding’s message version to create a strongly-typed message. For example:

var message = Message.CreateMessage(bind.MessageVersion, "http://www.onvif.org/ver10/device/wsdl/GetSystemDateAndTime");
// You can then send this message via your client channel or request factory

内容的提问来源于stack exchange,提问作者LoukMouk

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:57:09