【问题标题】:Generating C# script with ONVIF's .wsdl files on linux在 Linux 上使用 ONVIF 的 .wsdl 文件生成 C# 脚本
【发布时间】:2019-06-24 05:36:25
【问题描述】:

我正在尝试使用 wsdl-soap 服务规范生成包含 ONVIF 提供的网络接口的 C Sharp 源文件,具体如下所列:

我在 Arch Linux 上使用通用文本编辑器。如果可能,我希望解决方案基于控制台。

使用有效且可编译/运行的 csproj,我使用命令 wsdlwsdl2 尝试生成所需的输出文件。进程以空输出和错误退出:

[connor@archlinux /home/connor/Workspace/csharp/Camera]
 $ ls
bin  Camera.csproj  obj  ONVIF.cs  Program.cs
[connor@archlinux /home/connor/Workspace/csharp/Camera]
 $ wsdl https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl
Web Services Description Language Utility
Mono Framework v4.0.30319.42000

There were some warnings while generating the code:

  https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl
    - This web reference does not conform to WS-I Basic Profile v1.1
        Rxxxx: HelpGeneratorServiceConformanceRxxxx

Writing file 'output.cs'
[connor@archlinux /home/connor/Workspace/csharp/Camera]
 $ ls
bin  Camera.csproj  obj  ONVIF.cs  output.cs  Program.cs

output.cs 文件的内容是空的,它包含一些 cmets,但没有任何用处(cmets 指定该文件是自动生成的)。


如何使用控制台在 Arch Linux 上使用 ONVIF 的服务定义生成源文件?

【问题讨论】:

  • 你能用你使用的参数添加确切的命令吗?

标签: c# soap wsdl onvif


【解决方案1】:

您可以使用.Net Core 并使用以下命令安装 dotnet-svcutil:

dotnet tool install --global dotnet-svcutil

此时可以运行

dotnet-svcutil.exe https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl -o devicemgmt.cs

我永远无法使用单声道生成代码。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多