├── .gitignore ├── LICENSE ├── README.md ├── doc ├── ReadMe.txt └── svcutil.reg └── src ├── Directory.Build.props ├── OnvifClient ├── OnvifClient.csproj └── Program.cs ├── OnvifService ├── .template.config │ ├── dotnetcli.host.json │ ├── ide.host.json │ ├── ide │ │ └── Empty.png │ └── template.json ├── Controllers │ └── PreviewController.cs ├── Directory.Build.props ├── Onvif │ ├── DeviceImpl.cs │ ├── EventsImpl.cs │ ├── MediaImpl.cs │ ├── PTZImpl.cs │ └── SubscriptionManagerImpl.cs ├── OnvifService.csproj ├── Program.cs ├── Properties │ └── launchSettings.json ├── Repository │ └── UserRepository.cs ├── appsettings.Development.json ├── appsettings.json └── vaultboy.jpg ├── SharpOnvifClient.AccessControl ├── Connected Services │ └── OnvifAccessControl │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.AccessControl.csproj ├── SharpOnvifClient.AccessRules ├── Connected Services │ └── OnvifAccessRules │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.AccessRules.csproj ├── SharpOnvifClient.ActionEngine ├── Connected Services │ └── OnvifActionEngine │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.ActionEngine.csproj ├── SharpOnvifClient.AdvancedSecurity ├── Connected Services │ └── OnvifAdvancedSecurity │ │ ├── ConnectedService.json │ │ └── Reference.cs ├── Patch.cs └── SharpOnvifClient.AdvancedSecurity.csproj ├── SharpOnvifClient.Analytics ├── Connected Services │ └── OnvifAnalytics │ │ ├── ConnectedService.json │ │ └── Reference.cs ├── Patch.cs └── SharpOnvifClient.Analytics.csproj ├── SharpOnvifClient.AppMgmt ├── Connected Services │ └── OnvifAppMgmt │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.AppMgmt.csproj ├── SharpOnvifClient.AuthenticationBehavior ├── Connected Services │ └── OnvifAuthenticationBehavior │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.AuthenticationBehavior.csproj ├── SharpOnvifClient.Credential ├── Connected Services │ └── OnvifCredential │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Credential.csproj ├── SharpOnvifClient.DeviceIO ├── Connected Services │ └── OnvifDeviceIO │ │ ├── ConnectedService.json │ │ └── Reference.cs ├── Patch.cs └── SharpOnvifClient.DeviceIO.csproj ├── SharpOnvifClient.DeviceMgmt ├── Connected Services │ └── OnvifDeviceMgmt │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.DeviceMgmt.csproj ├── SharpOnvifClient.Display ├── Connected Services │ └── OnvifDisplay │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Display.csproj ├── SharpOnvifClient.DoorControl ├── Connected Services │ └── OnvifDoorControl │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.DoorControl.csproj ├── SharpOnvifClient.Events ├── Connected Services │ └── OnvifEvents │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Events.csproj ├── SharpOnvifClient.Imaging ├── Connected Services │ └── OnvifImaging │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Imaging.csproj ├── SharpOnvifClient.Media ├── Connected Services │ └── OnvifMedia │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Media.csproj ├── SharpOnvifClient.Media2 ├── Connected Services │ └── OnvifMedia2 │ │ ├── ConnectedService.json │ │ └── Reference.cs ├── Patch.cs └── SharpOnvifClient.Media2.csproj ├── SharpOnvifClient.PTZ ├── Connected Services │ └── OnvifPTZ │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.PTZ.csproj ├── SharpOnvifClient.Provisioning ├── Connected Services │ └── OnvifProvisioning │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Provisioning.csproj ├── SharpOnvifClient.Receiver ├── Connected Services │ └── OnvifReceiver │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Receiver.csproj ├── SharpOnvifClient.Recording ├── Connected Services │ └── OnvifRecording │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Recording.csproj ├── SharpOnvifClient.Replay ├── Connected Services │ └── OnvifReplay │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Replay.csproj ├── SharpOnvifClient.Schedule ├── Connected Services │ └── OnvifSchedule │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Schedule.csproj ├── SharpOnvifClient.Search ├── Connected Services │ └── OnvifSearch │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Search.csproj ├── SharpOnvifClient.Thermal ├── Connected Services │ └── OnvifThermal │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Thermal.csproj ├── SharpOnvifClient.Uplink ├── Connected Services │ └── OnvifUplink │ │ ├── ConnectedService.json │ │ └── Reference.cs └── SharpOnvifClient.Uplink.csproj ├── SharpOnvifClient.sln ├── SharpOnvifClient ├── Behaviors │ ├── DisableExpect100ContinueBehavior.cs │ ├── DisableExpect100ContinueBehaviorExtensions.cs │ └── DisableExpect100ContinueMessageHandler.cs ├── OnvifAuthenticationExtensions.cs ├── OnvifBindingFactory.cs ├── OnvifDiscoveryClient.cs ├── OnvifEvents.cs ├── Security │ ├── IHasUtcOffset.cs │ ├── WsUsernameTokenBehavior.cs │ ├── WsUsernameTokenHeader.cs │ └── WsUsernameTokenHeaderInspector.cs ├── SharpOnvifClient.csproj ├── SimpleOnvifClient.cs ├── SimpleOnvifClientExtensions.cs └── SimpleOnvifEventListener.cs ├── SharpOnvifCommon ├── NetworkHelpers.cs ├── OnvifHelpers.cs ├── OnvifServices.cs ├── OnvifWsdl.cs ├── PTZ │ └── Spaces.cs ├── Security │ ├── DigestHelpers.cs │ ├── Nonce.cs │ ├── Password.cs │ └── UsernameToken.cs └── SharpOnvifCommon.csproj ├── SharpOnvifServer.AccessControl ├── OnvifAccessControl.cs ├── PACSPortBase.cs └── SharpOnvifServer.AccessControl.csproj ├── SharpOnvifServer.AccessRules ├── AccessRulesPortBase.cs ├── OnvifAccessRules.cs └── SharpOnvifServer.AccessRules.csproj ├── SharpOnvifServer.ActionEngine ├── ActionEnginePortBase.cs ├── OnvifActionEngine.cs └── SharpOnvifServer.ActionEngine.csproj ├── SharpOnvifServer.AdvancedSecurity ├── AdvancedSecurityServiceBase.cs ├── AuthorizationServerBase.cs ├── Dot1XBase.cs ├── JWTBase.cs ├── KeystoreBase.cs ├── OnvifAdvancedSecurity.cs ├── SharpOnvifServer.AdvancedSecurity.csproj └── TLSServerBase.cs ├── SharpOnvifServer.Analytics ├── AnalyticsEnginePortBase.cs ├── OnvifAnalytics.cs ├── Patch.cs ├── RuleEnginePortBase.cs └── SharpOnvifServer.Analytics.csproj ├── SharpOnvifServer.AppMgmt ├── AppManagementBase.cs ├── OnvifAppMgmt.cs └── SharpOnvifServer.AppMgmt.csproj ├── SharpOnvifServer.AuthenticationBehavior ├── AuthenticationBehaviorPortBase.cs ├── OnvifAuthenticationBehavior.cs └── SharpOnvifServer.AuthenticationBehavior.csproj ├── SharpOnvifServer.Credential ├── CredentialPortBase.cs ├── OnvifCredential.cs └── SharpOnvifServer.Credential.csproj ├── SharpOnvifServer.DeviceIO ├── DeviceIOPortBase.cs ├── OnvifDeviceIO.cs └── SharpOnvifServer.DeviceIO.csproj ├── SharpOnvifServer.DeviceMgmt ├── DeviceBase.cs ├── OnvifDeviceMgmt.cs ├── Patch.cs └── SharpOnvifServer.DeviceMgmt.csproj ├── SharpOnvifServer.Display ├── DisplayPortBase.cs ├── OnvifDisplay.cs └── SharpOnvifServer.Display.csproj ├── SharpOnvifServer.DoorControl ├── DoorControlPortBase.cs ├── OnvifDoorControl.cs └── SharpOnvifServer.DoorControl.csproj ├── SharpOnvifServer.Events ├── EventsBase.cs ├── NotificationConsumerBase.cs ├── OnvifEvents.cs ├── SharpOnvifServer.Events.csproj └── SubscriptionManagerBase.cs ├── SharpOnvifServer.Imaging ├── ImagingPortBase.cs ├── OnvifImaging.cs └── SharpOnvifServer.Imaging.csproj ├── SharpOnvifServer.Media ├── MediaBase.cs ├── OnvifMedia.cs └── SharpOnvifServer.Media.csproj ├── SharpOnvifServer.Media2 ├── Media2Base.cs ├── OnvifMedia2.cs ├── Patch.cs └── SharpOnvifServer.Media2.csproj ├── SharpOnvifServer.PTZ ├── OnvifPTZ.cs ├── PTZBase.cs └── SharpOnvifServer.PTZ.csproj ├── SharpOnvifServer.Provisioning ├── OnvifProvisioning.cs ├── ProvisioningServiceBase.cs └── SharpOnvifServer.Provisioning.csproj ├── SharpOnvifServer.Receiver ├── OnvifReceiver.cs ├── ReceiverPortBase.cs └── SharpOnvifServer.Receiver.csproj ├── SharpOnvifServer.Recording ├── OnvifRecording.cs ├── RecordingPortBase.cs └── SharpOnvifServer.Recording.csproj ├── SharpOnvifServer.Replay ├── OnvifReplay.cs ├── ReplayPortBase.cs └── SharpOnvifServer.Replay.csproj ├── SharpOnvifServer.Schedule ├── OnvifSchedule.cs ├── SchedulePortBase.cs └── SharpOnvifServer.Schedule.csproj ├── SharpOnvifServer.Search ├── OnvifSearch.cs ├── SearchPortBase.cs └── SharpOnvifServer.Search.csproj ├── SharpOnvifServer.Thermal ├── OnvifThermal.cs ├── SharpOnvifServer.Thermal.csproj └── ThermalPortBase.cs ├── SharpOnvifServer.Uplink ├── OnvifUplink.cs ├── SharpOnvifServer.Uplink.csproj └── UplinkPortBase.cs ├── SharpOnvifServer.sln └── SharpOnvifServer ├── Discovery └── DiscoveryService.cs ├── IUserRepository.cs ├── OnvifBindingFactory.cs ├── OnvifEvents.cs ├── OnvifExtensions.cs ├── Security ├── DigestAuthenticationHandler.cs └── DisableMustUnderstandAttribute.cs └── SharpOnvifServer.csproj /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Lukas Volf 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /doc/ReadMe.txt: -------------------------------------------------------------------------------- 1 | To make SvcUtil.exe working on Windows 11, import the included svcutil.reg into registry. This should fix the SSL issues, but it will affect all NET Framework apps on the machine. Be careful! 2 | 3 | To generate service contracts for the server, run: 4 | & "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\SvcUtil.exe" -sc /n:*,OnvifDeviceMgmt /out:OnvifDeviceMgmt.cs https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl 5 | 6 | To generate the event service contracts for the server, SvcUtil.exe is failing so we have to use dotnet-svcutil: 7 | dotnet-svcutil --sync --namespace *,SharpOnvifServer.Events --outputFile OnvifEvents.cs https://www.onvif.org/ver10/events/wsdl/event.wsdl 8 | 9 | Replace System.ServiceModel with CoreWCF in all auto-generated files. 10 | 11 | --- 12 | 13 | To generate the clients, run: 14 | dotnet-svcutil --namespace *,SharpOnvifClient.Events -d "Connected Services/OnvifEvents" https://www.onvif.org/ver10/events/wsdl/event.wsdl -------------------------------------------------------------------------------- /doc/svcutil.reg: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | 3 | [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319] 4 | "SystemDefaultTlsVersions"=dword:00000001 -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | True 4 | True 5 | disable 6 | $(ProjectName) 7 | 0.1.6 8 | Lukas Volf 9 | MIT 10 | https://github.com/jimm98y/SharpOnvif 11 | README.md 12 | https://github.com/jimm98y/SharpOnvif 13 | git 14 | onvif;camera;netstandard20;net8 15 | en-US 16 | 1.0.0 17 | $(Version) 18 | MIT 19 | A C# implementation of the Onvif interface - client as well as the server. All profiles are supported. 20 | 21 | 22 | 23 | True 24 | \ 25 | 26 | 27 | 28 | 29 | $(ProjectDir)..\..\nugets 30 | 31 | -------------------------------------------------------------------------------- /src/OnvifClient/OnvifClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | 6 | net8.0 7 | false 8 | false 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/OnvifService/.template.config/dotnetcli.host.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/dotnetcli.host", 3 | "symbolInfo": { 4 | "Framework": { 5 | "longName": "framework" 6 | }, 7 | "skipRestore": { 8 | "longName": "no-restore", 9 | "shortName": "" 10 | }, 11 | "kestrelHttpPort": { 12 | "isHidden": true 13 | }, 14 | "kestrelHttpsPort": { 15 | "isHidden": true 16 | }, 17 | "NoHttps": { 18 | "longName": "no-https", 19 | "shortName": "" 20 | }, 21 | "UseProgramMain": { 22 | "longName": "use-program-main", 23 | "shortName": "" 24 | }, 25 | "NoWsdl": { 26 | "longName": "no-wsdl", 27 | "shortName": "" 28 | } 29 | }, 30 | "usageExamples": [ 31 | "" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /src/OnvifService/.template.config/ide.host.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/ide.host", 3 | "order": 150, 4 | "icon": "ide/Empty.png", 5 | "disableHttpsSymbol": "NoHttps", 6 | "supportsDocker": true, 7 | "symbolInfo": [ 8 | { 9 | "id": "NoWsdl", 10 | "name": { 11 | "text": "Turn off WSDL metadata feature." 12 | }, 13 | "isVisible": true 14 | }, 15 | { 16 | "id": "UseProgramMain", 17 | "name": { 18 | "text": "Turn off minimal ASP.NET Core hosting model." 19 | }, 20 | "isVisible": true 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /src/OnvifService/.template.config/ide/Empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimm98y/SharpOnvif/1ce2961925802561eac4452d70714294950b9342/src/OnvifService/.template.config/ide/Empty.png -------------------------------------------------------------------------------- /src/OnvifService/Controllers/PreviewController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | namespace OnvifService.Controllers 5 | { 6 | [Authorize(AuthenticationSchemes = "Digest")] 7 | [Route("/[controller]")] 8 | public class PreviewController : Controller 9 | { 10 | [HttpGet] 11 | public IActionResult Index() 12 | { 13 | var image = System.IO.File.OpenRead("vaultboy.jpg"); 14 | return File(image, "image/jpeg"); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/OnvifService/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | True 4 | True 5 | disable 6 | $(ProjectName) 7 | 0.1.5 8 | Lukas Volf 9 | MIT 10 | https://github.com/jimm98y/SharpOnvif 11 | README.md 12 | https://github.com/jimm98y/SharpOnvif 13 | git 14 | onvif;camera;netstandard20;net8 15 | en-US 16 | 1.0.0 17 | $(Version) 18 | MIT 19 | A C# implementation of the Onvif interface - client as well as the server. All profiles are supported. 20 | 21 | 22 | 23 | True 24 | \ 25 | 26 | 27 | 28 | 29 | $(ProjectDir)..\..\nugets 30 | 31 | -------------------------------------------------------------------------------- /src/OnvifService/Onvif/SubscriptionManagerImpl.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting.Server; 2 | using Microsoft.Extensions.Logging; 3 | using SharpOnvifCommon; 4 | using SharpOnvifServer; 5 | using SharpOnvifServer.Events; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Threading.Tasks; 9 | 10 | namespace OnvifService.Onvif 11 | { 12 | public class SubscriptionManagerImpl : SubscriptionManagerBase 13 | { 14 | private readonly IServer _server; 15 | private readonly ILogger _logger; 16 | 17 | public SubscriptionManagerImpl(IServer server, ILogger logger) 18 | { 19 | _server = server; 20 | _logger = logger; 21 | } 22 | 23 | public override PullMessagesResponse PullMessages(PullMessagesRequest request) 24 | { 25 | Task.Delay(5000).Wait(); // forced delay 26 | 27 | return new PullMessagesResponse() 28 | { 29 | CurrentTime = DateTime.UtcNow, 30 | TerminationTime = DateTime.UtcNow.Add(OnvifHelpers.FromTimeout(request.Timeout)), 31 | NotificationMessage = new NotificationMessageHolderType[] 32 | { 33 | new NotificationMessageHolderType() 34 | { 35 | Any = OnvifEvents.CreateNotificationMessage( 36 | new NotificationMessage() 37 | { 38 | TopicNamespacePrefix = "tns1", 39 | TopicNamespace = "http://www.onvif.org/ver10/topics", 40 | Topic = "RuleEngine/CellMotionDetector/Motion", 41 | Created = DateTime.UtcNow, 42 | Source = new Dictionary() 43 | { 44 | { "VideoSourceConfigurationToken", "VideoSourceToken" }, 45 | { "VideoAnalyticsConfigurationToken", "VideoAnalyticsToken" }, 46 | { "Rule", "MyMotionDetectorRule" } 47 | }, 48 | Data = new Dictionary() 49 | { 50 | { "IsMotion", "true" } 51 | } 52 | }) 53 | } 54 | } 55 | }; 56 | } 57 | 58 | public override RenewResponse1 Renew(RenewRequest request) 59 | { 60 | return new RenewResponse1() 61 | { 62 | RenewResponse = new RenewResponse() 63 | { 64 | CurrentTime = DateTime.UtcNow, 65 | TerminationTime = DateTime.UtcNow.Add(OnvifHelpers.FromTimeout(request.Renew.TerminationTime)) 66 | } 67 | }; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/OnvifService/OnvifService.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net8.0 4 | false 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | PreserveNewest 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | True 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/OnvifService/Program.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF.Configuration; 2 | using CoreWCF.Description; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using OnvifService.Repository; 6 | using SharpOnvifServer; 7 | 8 | var builder = WebApplication.CreateBuilder(); 9 | builder.Services.AddServiceModelServices(); 10 | builder.Services.AddServiceModelMetadata(); 11 | builder.Services.AddSingleton(); 12 | 13 | builder.Services.AddControllers(); 14 | 15 | builder.Services.AddSingleton(); 16 | builder.Services.AddOnvifDigestAuthentication(); 17 | builder.Services.AddOnvifDiscovery(); 18 | 19 | builder.Services.AddSingleton(); 20 | builder.Services.AddSingleton(); 21 | builder.Services.AddSingleton(); 22 | builder.Services.AddSingleton(); 23 | builder.Services.AddSingleton(); 24 | 25 | var app = builder.Build(); 26 | 27 | app.UseAuthentication(); 28 | app.UseAuthorization(); 29 | 30 | app.UseOnvif(); 31 | 32 | ((IApplicationBuilder)app).UseServiceModel(serviceBuilder => 33 | { 34 | var serviceMetadataBehavior = app.Services.GetRequiredService(); 35 | serviceMetadataBehavior.HttpGetEnabled = true; 36 | 37 | serviceBuilder.AddService(); 38 | serviceBuilder.AddServiceEndpoint(OnvifBindingFactory.CreateBinding(), "/onvif/device_service"); 39 | 40 | serviceBuilder.AddService(); 41 | serviceBuilder.AddServiceEndpoint(OnvifBindingFactory.CreateBinding(), "/onvif/media_service"); 42 | 43 | var eventBinding = OnvifBindingFactory.CreateBinding(); 44 | serviceBuilder.AddService(); 45 | serviceBuilder.AddServiceEndpoint(eventBinding, "/onvif/events_service"); 46 | serviceBuilder.AddServiceEndpoint(eventBinding, "/onvif/events_service"); 47 | serviceBuilder.AddServiceEndpoint(eventBinding, "/onvif/events_service"); 48 | 49 | var subscriptionBinding = OnvifBindingFactory.CreateBinding(); 50 | serviceBuilder.AddService(); 51 | serviceBuilder.AddServiceEndpoint(subscriptionBinding, "/onvif/Events/SubManager"); 52 | serviceBuilder.AddServiceEndpoint(subscriptionBinding, "/onvif/Events/SubManager"); 53 | serviceBuilder.AddServiceEndpoint(subscriptionBinding, "/onvif/Events/SubManager"); 54 | 55 | serviceBuilder.AddService(); 56 | serviceBuilder.AddServiceEndpoint(OnvifBindingFactory.CreateBinding(), "/onvif/ptz_service"); 57 | 58 | // TODO: add more service endpoints 59 | }); 60 | 61 | app.MapControllers(); 62 | 63 | app.Run(); -------------------------------------------------------------------------------- /src/OnvifService/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "OnvifService": { 4 | "commandName": "Project", 5 | "environmentVariables": { 6 | "ASPNETCORE_ENVIRONMENT": "Development" 7 | }, 8 | //#if(NoHttps) 9 | //"applicationUrl": "http://localhost:5000", 10 | //#else 11 | "applicationUrl": "https://localhost:5001;http://localhost:5000" 12 | //#endif 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/OnvifService/Repository/UserRepository.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using SharpOnvifServer; 3 | using System.Threading.Tasks; 4 | 5 | namespace OnvifService.Repository 6 | { 7 | public class UserRepository : IUserRepository 8 | { 9 | private readonly IConfiguration _configuration; 10 | 11 | public UserRepository(IConfiguration configuration) 12 | { 13 | _configuration = configuration; 14 | } 15 | 16 | public Task GetUser(string userName) 17 | { 18 | if (string.Compare(userName, _configuration.GetValue("UserRepository:UserName"), true) == 0) 19 | { 20 | string password = _configuration.GetValue("UserRepository:Password"); 21 | return Task.FromResult(new UserInfo() { UserName = userName, Password = password }); 22 | } 23 | 24 | return Task.FromResult((UserInfo)null); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/OnvifService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/OnvifService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "UserRepository": { 10 | "UserName": "admin", 11 | "Password": "password" 12 | }, 13 | "MediaImpl": { 14 | "VideoWidth": 640, 15 | "VideoHeight": 480, 16 | "VideoFps": 25, 17 | "VideoRtspUri": "rtsp://localhost:8554/", 18 | "VideoSnapshotUri": "", 19 | "AudioChannels": 1, 20 | "AudioSampleBitrate": 44100 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/OnvifService/vaultboy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimm98y/SharpOnvif/1ce2961925802561eac4452d70714294950b9342/src/OnvifService/vaultboy.jpg -------------------------------------------------------------------------------- /src/SharpOnvifClient.AccessControl/Connected Services/OnvifAccessControl/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/pacs/accesscontrol.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.AccessControl" 12 | ], 13 | "references": [ 14 | "dotnet-Microsoft.XmlSerializer.Generator, {Microsoft.XmlSerializer.Generator, 8.0.0}", 15 | "Microsoft.Bcl.AsyncInterfaces, {Microsoft.Bcl.AsyncInterfaces, 5.0.0}", 16 | "Microsoft.Extensions.ObjectPool, {Microsoft.Extensions.ObjectPool, 5.0.10}", 17 | "System.Buffers, {System.Buffers, 4.5.1}", 18 | "System.Formats.Asn1, {System.Formats.Asn1, 6.0.0}", 19 | "System.Memory, {System.Memory, 4.5.4}", 20 | "System.Numerics.Vectors, {System.Numerics.Vectors, 4.5.0}", 21 | "System.Reflection.DispatchProxy, {System.Reflection.DispatchProxy, 4.7.1}", 22 | "System.Runtime.CompilerServices.Unsafe, {System.Runtime.CompilerServices.Unsafe, 4.5.3}", 23 | "System.Security.AccessControl, {System.Security.AccessControl, 6.0.0}", 24 | "System.Security.Cryptography.Cng, {System.Security.Cryptography.Cng, 5.0.0}", 25 | "System.Security.Cryptography.Pkcs, {System.Security.Cryptography.Pkcs, 6.0.1}", 26 | "System.Security.Cryptography.Xml, {System.Security.Cryptography.Xml, 6.0.1}", 27 | "System.Security.Principal.Windows, {System.Security.Principal.Windows, 5.0.0}", 28 | "System.ServiceModel, {System.ServiceModel.Primitives, 4.10.3}", 29 | "System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.10.3}", 30 | "System.ServiceModel.Http, {System.ServiceModel.Http, 4.10.3}", 31 | "System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.10.3}", 32 | "System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 4.10.3}", 33 | "System.ServiceModel.Security, {System.ServiceModel.Security, 4.10.3}", 34 | "System.Threading.Tasks.Extensions, {System.Threading.Tasks.Extensions, 4.5.4}" 35 | ], 36 | "targetFramework": "netstandard2.0", 37 | "typeReuseMode": "All" 38 | } 39 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.AccessControl/SharpOnvifClient.AccessControl.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.AccessRules/Connected Services/OnvifAccessRules/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/accessrules/wsdl/accessrules.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.AccessRules" 12 | ], 13 | "references": [ 14 | "System.ServiceModel, {System.ServiceModel.Primitives, 4.10.3}", 15 | "System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.10.3}", 16 | "System.ServiceModel.Http, {System.ServiceModel.Http, 4.10.3}", 17 | "System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.10.3}", 18 | "System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 4.10.3}", 19 | "System.ServiceModel.Security, {System.ServiceModel.Security, 4.10.3}" 20 | ], 21 | "targetFramework": "netstandard2.0", 22 | "typeReuseMode": "All" 23 | } 24 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.AccessRules/SharpOnvifClient.AccessRules.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.ActionEngine/Connected Services/OnvifActionEngine/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/actionengine.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.ActionEngine" 12 | ], 13 | "references": [ 14 | "System.ServiceModel, {System.ServiceModel.Primitives, 4.10.3}", 15 | "System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.10.3}", 16 | "System.ServiceModel.Http, {System.ServiceModel.Http, 4.10.3}", 17 | "System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.10.3}", 18 | "System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 4.10.3}", 19 | "System.ServiceModel.Security, {System.ServiceModel.Security, 4.10.3}" 20 | ], 21 | "targetFramework": "netstandard2.0", 22 | "typeReuseMode": "All" 23 | } 24 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.ActionEngine/SharpOnvifClient.ActionEngine.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.AdvancedSecurity/Connected Services/OnvifAdvancedSecurity/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.AdvancedSecurity" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.AdvancedSecurity/Patch.cs: -------------------------------------------------------------------------------- 1 | namespace SharpOnvifClient.AdvancedSecurity 2 | { 3 | // DNAttributeTypeAndValue[][] has to be changed to DNAttributeTypeAndValue[,] 4 | } 5 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.AdvancedSecurity/SharpOnvifClient.AdvancedSecurity.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Analytics/Connected Services/OnvifAnalytics/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Analytics" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Analytics/Patch.cs: -------------------------------------------------------------------------------- 1 | namespace SharpOnvifClient.Analytics 2 | { 3 | // Vector[][] has to be changed to Vector[,] 4 | 5 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 6 | public partial class Behaviour1 7 | { } 8 | 9 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 10 | public partial class Capabilities1 11 | { } 12 | 13 | [System.Xml.Serialization.XmlRoot(Namespace = "http://docs.oasis-open.org/wsn/b-2")] 14 | public partial class QueryExpressionType 15 | { } 16 | } 17 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Analytics/SharpOnvifClient.Analytics.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.AppMgmt/Connected Services/OnvifAppMgmt/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/appmgmt/wsdl/appmgmt.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.AppMgmt" 12 | ], 13 | "references": [ 14 | "System.ServiceModel, {System.ServiceModel.Primitives, 4.10.3}", 15 | "System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.10.3}", 16 | "System.ServiceModel.Http, {System.ServiceModel.Http, 4.10.3}", 17 | "System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.10.3}", 18 | "System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 4.10.3}", 19 | "System.ServiceModel.Security, {System.ServiceModel.Security, 4.10.3}" 20 | ], 21 | "targetFramework": "netstandard2.0", 22 | "typeReuseMode": "All" 23 | } 24 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.AppMgmt/SharpOnvifClient.AppMgmt.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.AuthenticationBehavior/Connected Services/OnvifAuthenticationBehavior/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/authenticationbehavior/wsdl/authenticationbehavior.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.AuthenticationBehavior" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.AuthenticationBehavior/SharpOnvifClient.AuthenticationBehavior.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Credential/Connected Services/OnvifCredential/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/credential/wsdl/credential.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Credential" 12 | ], 13 | "references": [ 14 | "System.ServiceModel, {System.ServiceModel.Primitives, 4.10.3}", 15 | "System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.10.3}", 16 | "System.ServiceModel.Http, {System.ServiceModel.Http, 4.10.3}", 17 | "System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.10.3}", 18 | "System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 4.10.3}", 19 | "System.ServiceModel.Security, {System.ServiceModel.Security, 4.10.3}" 20 | ], 21 | "targetFramework": "netstandard2.0", 22 | "typeReuseMode": "All" 23 | } 24 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Credential/SharpOnvifClient.Credential.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.DeviceIO/Connected Services/OnvifDeviceIO/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/deviceio.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.DeviceIO" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.DeviceIO/Patch.cs: -------------------------------------------------------------------------------- 1 | namespace SharpOnvifClient.DeviceIO 2 | { 3 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 4 | public partial class Capabilities 5 | { } 6 | 7 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 8 | public partial class SystemCapabilities1 9 | { } 10 | 11 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 12 | public partial class SecurityCapabilities1 13 | { } 14 | 15 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 16 | public partial class NetworkCapabilities1 17 | { } 18 | } 19 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.DeviceIO/SharpOnvifClient.DeviceIO.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.DeviceMgmt/Connected Services/OnvifDeviceMgmt/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.DeviceMgmt" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.DeviceMgmt/SharpOnvifClient.DeviceMgmt.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Display/Connected Services/OnvifDisplay/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/display.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Display" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Display/SharpOnvifClient.Display.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.DoorControl/Connected Services/OnvifDoorControl/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/pacs/doorcontrol.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.DoorControl" 12 | ], 13 | "references": [ 14 | "dotnet-Microsoft.XmlSerializer.Generator, {Microsoft.XmlSerializer.Generator, 8.0.0}", 15 | "Microsoft.Bcl.AsyncInterfaces, {Microsoft.Bcl.AsyncInterfaces, 5.0.0}", 16 | "Microsoft.Extensions.ObjectPool, {Microsoft.Extensions.ObjectPool, 5.0.10}", 17 | "System.Buffers, {System.Buffers, 4.5.1}", 18 | "System.Formats.Asn1, {System.Formats.Asn1, 6.0.0}", 19 | "System.Memory, {System.Memory, 4.5.4}", 20 | "System.Numerics.Vectors, {System.Numerics.Vectors, 4.5.0}", 21 | "System.Reflection.DispatchProxy, {System.Reflection.DispatchProxy, 4.7.1}", 22 | "System.Runtime.CompilerServices.Unsafe, {System.Runtime.CompilerServices.Unsafe, 4.5.3}", 23 | "System.Security.AccessControl, {System.Security.AccessControl, 6.0.0}", 24 | "System.Security.Cryptography.Cng, {System.Security.Cryptography.Cng, 5.0.0}", 25 | "System.Security.Cryptography.Pkcs, {System.Security.Cryptography.Pkcs, 6.0.1}", 26 | "System.Security.Cryptography.Xml, {System.Security.Cryptography.Xml, 6.0.1}", 27 | "System.Security.Principal.Windows, {System.Security.Principal.Windows, 5.0.0}", 28 | "System.ServiceModel, {System.ServiceModel.Primitives, 4.10.3}", 29 | "System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.10.3}", 30 | "System.ServiceModel.Http, {System.ServiceModel.Http, 4.10.3}", 31 | "System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.10.3}", 32 | "System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 4.10.3}", 33 | "System.ServiceModel.Security, {System.ServiceModel.Security, 4.10.3}", 34 | "System.Threading.Tasks.Extensions, {System.Threading.Tasks.Extensions, 4.5.4}" 35 | ], 36 | "targetFramework": "netstandard2.0", 37 | "typeReuseMode": "All" 38 | } 39 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.DoorControl/SharpOnvifClient.DoorControl.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Events/Connected Services/OnvifEvents/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/events/wsdl/event.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Events" 12 | ], 13 | "references": [ 14 | "dotnet-Microsoft.XmlSerializer.Generator, {Microsoft.XmlSerializer.Generator, 8.0.0}", 15 | "Microsoft.Bcl.AsyncInterfaces, {Microsoft.Bcl.AsyncInterfaces, 5.0.0}", 16 | "Microsoft.Extensions.ObjectPool, {Microsoft.Extensions.ObjectPool, 5.0.10}", 17 | "System.Buffers, {System.Buffers, 4.5.1}", 18 | "System.Formats.Asn1, {System.Formats.Asn1, 6.0.0}", 19 | "System.Memory, {System.Memory, 4.5.4}", 20 | "System.Numerics.Vectors, {System.Numerics.Vectors, 4.5.0}", 21 | "System.Reflection.DispatchProxy, {System.Reflection.DispatchProxy, 4.7.1}", 22 | "System.Runtime.CompilerServices.Unsafe, {System.Runtime.CompilerServices.Unsafe, 4.5.3}", 23 | "System.Security.AccessControl, {System.Security.AccessControl, 6.0.0}", 24 | "System.Security.Cryptography.Cng, {System.Security.Cryptography.Cng, 5.0.0}", 25 | "System.Security.Cryptography.Pkcs, {System.Security.Cryptography.Pkcs, 6.0.1}", 26 | "System.Security.Cryptography.Xml, {System.Security.Cryptography.Xml, 6.0.1}", 27 | "System.Security.Principal.Windows, {System.Security.Principal.Windows, 5.0.0}", 28 | "System.ServiceModel, {System.ServiceModel.Primitives, 4.10.3}", 29 | "System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.10.3}", 30 | "System.ServiceModel.Http, {System.ServiceModel.Http, 4.10.3}", 31 | "System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.10.3}", 32 | "System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 4.10.3}", 33 | "System.ServiceModel.Security, {System.ServiceModel.Security, 4.10.3}", 34 | "System.Threading.Tasks.Extensions, {System.Threading.Tasks.Extensions, 4.5.4}" 35 | ], 36 | "targetFramework": "netstandard2.0", 37 | "typeReuseMode": "All" 38 | } 39 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Events/SharpOnvifClient.Events.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Imaging/Connected Services/OnvifImaging/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver20/imaging/wsdl/imaging.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Imaging" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Imaging/SharpOnvifClient.Imaging.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Media/Connected Services/OnvifMedia/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/media/wsdl/media.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Media" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Media/SharpOnvifClient.Media.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Media2/Connected Services/OnvifMedia2/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver20/media/wsdl/media.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Media2" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Media2/Patch.cs: -------------------------------------------------------------------------------- 1 | namespace SharpOnvifClient.Media2 2 | { 3 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 4 | public partial class ReceiverConfiguration 5 | { } 6 | } 7 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Media2/SharpOnvifClient.Media2.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.PTZ/Connected Services/OnvifPTZ/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver20/ptz/wsdl/ptz.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.PTZ" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.PTZ/SharpOnvifClient.PTZ.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Provisioning/Connected Services/OnvifProvisioning/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/provisioning/wsdl/provisioning.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Provisioning" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Provisioning/SharpOnvifClient.Provisioning.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Receiver/Connected Services/OnvifReceiver/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/receiver.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Receiver" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Receiver/SharpOnvifClient.Receiver.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Recording/Connected Services/OnvifRecording/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/recording.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Recording" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Recording/SharpOnvifClient.Recording.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Replay/Connected Services/OnvifReplay/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/replay.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Replay" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Replay/SharpOnvifClient.Replay.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Schedule/Connected Services/OnvifSchedule/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/schedule/wsdl/schedule.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Schedule" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Schedule/SharpOnvifClient.Schedule.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Search/Connected Services/OnvifSearch/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/search.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Search" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Search/SharpOnvifClient.Search.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Thermal/Connected Services/OnvifThermal/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/thermal/wsdl/thermal.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Thermal" 12 | ], 13 | "targetFramework": "netstandard2.0", 14 | "typeReuseMode": "All" 15 | } 16 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Thermal/SharpOnvifClient.Thermal.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient.Uplink/Connected Services/OnvifUplink/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.onvif.org/ver10/uplink/wsdl/uplink.wsdl" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "namespaceMappings": [ 11 | "*, SharpOnvifClient.Uplink" 12 | ], 13 | "references": [ 14 | "System.ServiceModel, {System.ServiceModel.Primitives, 4.10.3}", 15 | "System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.10.3}", 16 | "System.ServiceModel.Http, {System.ServiceModel.Http, 4.10.3}", 17 | "System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.10.3}", 18 | "System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 4.10.3}", 19 | "System.ServiceModel.Security, {System.ServiceModel.Security, 4.10.3}" 20 | ], 21 | "targetFramework": "netstandard2.0", 22 | "typeReuseMode": "All" 23 | } 24 | } -------------------------------------------------------------------------------- /src/SharpOnvifClient.Uplink/SharpOnvifClient.Uplink.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/Behaviors/DisableExpect100ContinueBehavior.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.ServiceModel.Channels; 4 | using System.ServiceModel.Description; 5 | using System.ServiceModel.Dispatcher; 6 | 7 | namespace SharpOnvifClient.Behaviors 8 | { 9 | public class DisableExpect100ContinueBehavior : IEndpointBehavior 10 | { 11 | public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) 12 | { 13 | bindingParameters.Add(new Func(GetHttpMessageHandler)); 14 | } 15 | 16 | public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) { } 17 | 18 | public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) { } 19 | 20 | public void Validate(ServiceEndpoint endpoint) { } 21 | 22 | public HttpMessageHandler GetHttpMessageHandler(HttpClientHandler httpClientHandler) 23 | { 24 | return new DisableExpect100ContinueMessageHandler(httpClientHandler); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/Behaviors/DisableExpect100ContinueBehaviorExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ServiceModel; 3 | 4 | namespace SharpOnvifClient.Behaviors 5 | { 6 | public static class DisableExpect100ContinueBehaviorExtensions 7 | { 8 | public static void SetDisableExpect100Continue( 9 | this ClientBase channel, 10 | System.ServiceModel.Description.IEndpointBehavior disableExpect100Continue = null) where TChannel : class 11 | { 12 | if (disableExpect100Continue == null) 13 | return; 14 | 15 | if (!channel.Endpoint.EndpointBehaviors.Contains(disableExpect100Continue)) 16 | { 17 | channel.Endpoint.EndpointBehaviors.Add(disableExpect100Continue); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/Behaviors/DisableExpect100ContinueMessageHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | 5 | namespace SharpOnvifClient.Behaviors 6 | { 7 | public class DisableExpect100ContinueMessageHandler : DelegatingHandler 8 | { 9 | public DisableExpect100ContinueMessageHandler(HttpMessageHandler innerHandler) 10 | { 11 | InnerHandler = innerHandler; 12 | } 13 | 14 | protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 15 | { 16 | HttpResponseMessage response; 17 | 18 | request.Headers.ExpectContinue = false; 19 | response = await base.SendAsync(request, cancellationToken); 20 | 21 | return response; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/OnvifAuthenticationExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Net; 4 | using System.ServiceModel; 5 | #if NETSTANDARD 6 | using System.Reflection; 7 | #endif 8 | 9 | namespace SharpOnvifClient 10 | { 11 | [Flags] 12 | public enum OnvifAuthentication 13 | { 14 | None = 0, 15 | WsUsernameToken = 1, 16 | HttpDigest = 2 17 | } 18 | 19 | public static class OnvifAuthenticationExtensions 20 | { 21 | public static void SetOnvifAuthentication( 22 | this ClientBase channel, 23 | OnvifAuthentication authentication, 24 | NetworkCredential credentials, 25 | System.ServiceModel.Description.IEndpointBehavior legacyAuth = null) where TChannel : class 26 | { 27 | if (authentication == OnvifAuthentication.None) 28 | { 29 | Debug.WriteLine("Authentication is disabled"); 30 | return; 31 | } 32 | 33 | if (authentication.HasFlag(OnvifAuthentication.HttpDigest)) 34 | { 35 | #if NETSTANDARD 36 | // Workaround for netstandard2.0 where when used in NETFramework 4.8.1 the AllowedImpersonationLevel property is set to Identification instead of Impersonation. 37 | try 38 | { 39 | var allowedImpersonationLevelProperty = channel.ClientCredentials.HttpDigest.GetType().GetTypeInfo().GetProperty("AllowedImpersonationLevel", BindingFlags.Instance | BindingFlags.Public); 40 | if (allowedImpersonationLevelProperty != null) 41 | { 42 | // Due to the limitations of Digest authentication, when the client is using non-default credentials, only Impersonation and Delegation levels are allowed. 43 | allowedImpersonationLevelProperty.SetValue(channel.ClientCredentials.HttpDigest, System.Security.Principal.TokenImpersonationLevel.Impersonation); 44 | } 45 | } 46 | catch (Exception ex) 47 | { 48 | Debug.WriteLine($"Error setting impersonation level: {ex.Message}"); 49 | } 50 | #elif NETFRAMEWORK 51 | channel.ClientCredentials.HttpDigest.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; 52 | #endif 53 | 54 | // HTTP Digest authentication is handled by WCF 55 | channel.ClientCredentials.HttpDigest.ClientCredential = credentials; 56 | } 57 | 58 | if (authentication.HasFlag(OnvifAuthentication.WsUsernameToken)) 59 | { 60 | if(legacyAuth == null) 61 | throw new ArgumentNullException(nameof(legacyAuth)); 62 | 63 | // legacy WsUsernameToken authentication must be handled using a custom behavior 64 | if (!channel.Endpoint.EndpointBehaviors.Contains(legacyAuth)) 65 | { 66 | channel.Endpoint.EndpointBehaviors.Add(legacyAuth); 67 | } 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/OnvifBindingFactory.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.ServiceModel; 3 | using System.ServiceModel.Channels; 4 | 5 | namespace SharpOnvifClient 6 | { 7 | /// 8 | /// Helper class for the WCF auto-generated stubs. 9 | /// 10 | public static class OnvifBindingFactory 11 | { 12 | public static Binding CreateBinding() 13 | { 14 | var httpTransportBinding = new HttpTransportBindingElement 15 | { 16 | AuthenticationScheme = AuthenticationSchemes.Digest 17 | }; 18 | var textMessageEncodingBinding = new TextMessageEncodingBindingElement 19 | { 20 | MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None) 21 | }; 22 | var customBinding = new CustomBinding(textMessageEncodingBinding, httpTransportBinding); 23 | return customBinding; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/OnvifEvents.cs: -------------------------------------------------------------------------------- 1 | using SharpOnvifClient.Events; 2 | using System.Linq; 3 | 4 | namespace SharpOnvifClient 5 | { 6 | public static class OnvifEvents 7 | { 8 | private static bool ContainsTrueValue(string eventXml) 9 | { 10 | string str = eventXml.ToLowerInvariant(); 11 | return str.Contains("value=\"true\"") || str.Contains("value=\"1\""); 12 | } 13 | 14 | public static bool? IsMotionDetected(NotificationMessageHolderType message) 15 | { 16 | return IsMotionDetected(string.Concat(message.Topic.Any.First().Value, message.Message.InnerXml)); 17 | } 18 | public static bool? IsMotionDetected(string eventXml) 19 | { 20 | if (!IsMotionEvent(eventXml)) return null; 21 | return ContainsTrueValue(eventXml); 22 | } 23 | private static bool IsMotionEvent(string eventXml) 24 | { 25 | if (string.IsNullOrEmpty(eventXml)) 26 | return false; 27 | 28 | string str = eventXml.ToLowerInvariant(); 29 | return 30 | str.Contains("RuleEngine/CellMotionDetector/Motion".ToLowerInvariant()) || 31 | str.Contains("RuleEngine/MotionRegionDetector/Motion".ToLowerInvariant()) || 32 | str.Contains("VideoSource/MotionAlarm".ToLowerInvariant()); 33 | } 34 | 35 | public static bool? IsTamperDetected(NotificationMessageHolderType message) 36 | { 37 | return IsTamperDetected(string.Concat(message.Topic.Any.First().Value, message.Message.InnerXml)); 38 | } 39 | public static bool? IsTamperDetected(string eventXml) 40 | { 41 | if (!IsTamperEvent(eventXml)) return null; 42 | return ContainsTrueValue(eventXml); 43 | } 44 | private static bool IsTamperEvent(string eventXml) 45 | { 46 | if (string.IsNullOrEmpty(eventXml)) 47 | return false; 48 | 49 | string str = eventXml.ToLowerInvariant(); 50 | return str.Contains("RuleEngine/TamperDetector/Tamper".ToLowerInvariant()); 51 | } 52 | 53 | public static bool? IsSoundDetected(NotificationMessageHolderType message) 54 | { 55 | return IsSoundDetected(string.Concat(message.Topic.Any.First().Value, message.Message.InnerXml)); 56 | } 57 | public static bool? IsSoundDetected(string eventXml) 58 | { 59 | if (!IsSoundEvent(eventXml)) return null; 60 | return ContainsTrueValue(eventXml); 61 | } 62 | private static bool IsSoundEvent(string eventXml) 63 | { 64 | if (string.IsNullOrEmpty(eventXml)) 65 | return false; 66 | 67 | string str = eventXml.ToLowerInvariant(); 68 | return str.Contains("AudioAnalytics/Audio/DetectedSound".ToLowerInvariant()); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/Security/IHasUtcOffset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SharpOnvifClient.Security 4 | { 5 | public interface IHasUtcOffset 6 | { 7 | TimeSpan UtcNowOffset { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/Security/WsUsernameTokenBehavior.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.ServiceModel.Channels; 4 | using System.ServiceModel.Description; 5 | using System.ServiceModel.Dispatcher; 6 | 7 | namespace SharpOnvifClient.Security 8 | { 9 | public sealed class WsUsernameTokenBehavior : IEndpointBehavior, IHasUtcOffset 10 | { 11 | private readonly NetworkCredential _credentials; 12 | 13 | public TimeSpan UtcNowOffset { get; set; } = TimeSpan.Zero; 14 | 15 | public WsUsernameTokenBehavior(NetworkCredential credentials) 16 | { 17 | this._credentials = credentials; 18 | } 19 | 20 | public WsUsernameTokenBehavior(NetworkCredential credentials, TimeSpan utcNowOffset) : this(credentials) 21 | { 22 | this.UtcNowOffset = utcNowOffset; 23 | } 24 | 25 | public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) 26 | { 27 | // do nothing 28 | } 29 | 30 | public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) 31 | { 32 | clientRuntime.ClientMessageInspectors.Add(new WsUsernameTokenHeaderInspector(_credentials, UtcNowOffset)); 33 | } 34 | 35 | public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) 36 | { 37 | throw new NotImplementedException(); 38 | } 39 | 40 | public void Validate(ServiceEndpoint endpoint) 41 | { 42 | // do nothing 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/Security/WsUsernameTokenHeader.cs: -------------------------------------------------------------------------------- 1 | using SharpOnvifCommon; 2 | using SharpOnvifCommon.Security; 3 | using System; 4 | using System.Net; 5 | using System.ServiceModel.Channels; 6 | using System.Xml; 7 | using System.Xml.Serialization; 8 | 9 | namespace SharpOnvifClient.Security 10 | { 11 | /// 12 | /// Security header for the WsUsernameToken authentication. 13 | /// 14 | /// https://stapp.space/using-soap-security-in-dotnet-core/ 15 | public sealed class WsUsernameTokenHeader : MessageHeader 16 | { 17 | private readonly string _nonce; 18 | private readonly string _created; 19 | private NetworkCredential _credentials; 20 | 21 | public WsUsernameTokenHeader(NetworkCredential credentials, DateTime created) 22 | { 23 | this._credentials = credentials; 24 | _nonce = DigestHelpers.CalculateNonce(); 25 | _created = OnvifHelpers.DateTimeToString(created); 26 | } 27 | 28 | public override string Name { get; } = "Security"; 29 | 30 | public override string Namespace { get; } = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; 31 | 32 | protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion) 33 | { 34 | var serializer = new XmlSerializer(typeof(UsernameToken)); 35 | var pass = DigestHelpers.CreateSoapDigest(_nonce, _created, _credentials.Password); 36 | serializer.Serialize(writer, 37 | new UsernameToken 38 | { 39 | Username = _credentials.UserName, 40 | Password = new Password 41 | { 42 | Text = pass, 43 | Type = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest" 44 | }, 45 | Nonce = new Nonce 46 | { 47 | Text = _nonce, 48 | EncodingType = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" 49 | }, 50 | Created = _created 51 | }); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/Security/WsUsernameTokenHeaderInspector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.ServiceModel; 4 | using System.ServiceModel.Channels; 5 | using System.ServiceModel.Dispatcher; 6 | 7 | namespace SharpOnvifClient.Security 8 | { 9 | public sealed class WsUsernameTokenHeaderInspector : IClientMessageInspector 10 | { 11 | private readonly TimeSpan _utcNowOffset = TimeSpan.Zero; 12 | private readonly NetworkCredential _credentials; 13 | 14 | public WsUsernameTokenHeaderInspector(NetworkCredential credentials, TimeSpan utcNowOffset) 15 | { 16 | this._credentials = credentials; 17 | this._utcNowOffset = utcNowOffset; 18 | } 19 | 20 | public void AfterReceiveReply(ref Message reply, object correlationState) 21 | { } 22 | 23 | public object BeforeSendRequest(ref Message request, IClientChannel channel) 24 | { 25 | request.Headers.Add(new WsUsernameTokenHeader(_credentials, DateTime.UtcNow.Add(_utcNowOffset))); 26 | return null; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/SharpOnvifClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/SharpOnvifClient/SimpleOnvifClientExtensions.cs: -------------------------------------------------------------------------------- 1 | using SharpOnvifClient.Events; 2 | using SharpOnvifClient.Media; 3 | using System.Threading.Tasks; 4 | 5 | namespace SharpOnvifClient 6 | { 7 | public static class SimpleOnvifClientExtensions 8 | { 9 | public static Task GetStreamUriAsync(this SimpleOnvifClient client, Profile profile) 10 | { 11 | return client.GetStreamUriAsync(profile.token); 12 | } 13 | 14 | public static Task PullPointPullMessagesAsync(this SimpleOnvifClient client, CreatePullPointSubscriptionResponse subscribeResponse, int timeoutInSeconds = 60, int maxMessages = 100) 15 | { 16 | return client.PullPointPullMessagesAsync(subscribeResponse.SubscriptionReference.Address.Value, timeoutInSeconds, maxMessages); 17 | } 18 | 19 | public static Task BasicSubscriptionRenewAsync(this SimpleOnvifClient client, SubscribeResponse1 subscribeResponse, int timeoutInMinutes = 5) 20 | { 21 | return client.BasicSubscriptionRenewAsync(subscribeResponse.SubscribeResponse.SubscriptionReference.Address.Value, timeoutInMinutes); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/SharpOnvifCommon/NetworkHelpers.cs: -------------------------------------------------------------------------------- 1 | using System.Net.NetworkInformation; 2 | using System.Linq; 3 | 4 | namespace SharpOnvifCommon 5 | { 6 | public static class NetworkHelpers 7 | { 8 | private static NetworkInterface GetPrimaryNetworkInterface() 9 | { 10 | return NetworkInterface.GetAllNetworkInterfaces().FirstOrDefault( 11 | i => i.NetworkInterfaceType != NetworkInterfaceType.Loopback && 12 | i.NetworkInterfaceType != NetworkInterfaceType.Tunnel 13 | ); 14 | } 15 | 16 | public static string GetIPv4NetworkInterface() 17 | { 18 | var nic = GetPrimaryNetworkInterface(); 19 | return nic.GetIPProperties().UnicastAddresses.FirstOrDefault(x => x.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)?.Address.ToString(); 20 | } 21 | 22 | public static string GetIPv4NetworkInterfaceDns() 23 | { 24 | var nic = GetPrimaryNetworkInterface(); 25 | return nic.GetIPProperties().DnsAddresses.FirstOrDefault(x => x.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)?.ToString(); 26 | } 27 | 28 | public static string GetPrimaryNetworkInterfaceMAC() 29 | { 30 | var nic = GetPrimaryNetworkInterface(); 31 | return nic.GetPhysicalAddress().ToString(); 32 | } 33 | 34 | public static string GetIPv4NTPAddress(string ntp = "time.windows.com") 35 | { 36 | return System.Net.Dns.GetHostEntry(ntp).AddressList.FirstOrDefault(x => x.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)?.ToString(); 37 | } 38 | 39 | public static string GetIPv4NetworkInterfaceGateway() 40 | { 41 | var nic = GetPrimaryNetworkInterface(); 42 | return nic.GetIPProperties().GatewayAddresses.FirstOrDefault(x => x.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).Address?.ToString(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/SharpOnvifCommon/OnvifHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SharpOnvifCommon 4 | { 5 | public static class OnvifHelpers 6 | { 7 | public static string GetTimeoutInSeconds(int timeoutInSeconds) 8 | { 9 | return $"PT{timeoutInSeconds}S"; 10 | } 11 | 12 | public static string GetTimeoutInMinutes(int timeoutInMinutes) 13 | { 14 | return $"PT{timeoutInMinutes}M"; 15 | } 16 | 17 | public static string DateTimeToString(DateTime dateTime) 18 | { 19 | return dateTime.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); 20 | } 21 | 22 | public static TimeSpan FromTimeout(string timeout) 23 | { 24 | if(string.IsNullOrEmpty(timeout)) 25 | return TimeSpan.Zero; 26 | 27 | timeout = timeout.ToUpperInvariant(); 28 | if(timeout.StartsWith("PT")) 29 | { 30 | int number; 31 | if (int.TryParse(timeout.Substring(2, timeout.Length - 3), out number)) 32 | { 33 | if (timeout.EndsWith("M")) 34 | { 35 | return TimeSpan.FromMinutes(number); 36 | } 37 | else if (timeout.EndsWith("S")) 38 | { 39 | return TimeSpan.FromMinutes(number); 40 | } 41 | } 42 | } 43 | 44 | throw new NotSupportedException(timeout); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/SharpOnvifCommon/OnvifServices.cs: -------------------------------------------------------------------------------- 1 | namespace SharpOnvifCommon 2 | { 3 | public static class OnvifServices 4 | { 5 | public const string ACCESS_CONTROL = "http://www.onvif.org/ver10/accesscontrol/wsdl"; 6 | public const string ACCESS_RULES = "http://www.onvif.org/ver10/accessrules/wsdl"; 7 | public const string ACTION_ENGINE = "http://www.onvif.org/ver10/actionengine/wsdl"; 8 | public const string ADVANCED_SECURITY = "http://www.onvif.org/ver10/advancedsecurity/wsdl"; 9 | public const string ANALYTICS = "http://www.onvif.org/ver20/analytics/wsdl"; 10 | public const string APP_MGMT = "http://www.onvif.org/ver10/appmgmt/wsdl"; 11 | public const string AUTHENTICATION_BEHAVIOR = "http://www.onvif.org/ver10/authenticationbehavior/wsdl"; 12 | public const string CREDENTIAL = "http://www.onvif.org/ver10/credential/wsdl"; 13 | public const string DEVICE_IO = "http://www.onvif.org/ver10/device/wsdl"; 14 | public const string DEVICE_MGMT = "http://www.onvif.org/ver10/device/wsdl"; 15 | public const string DISPLAY = "http://www.onvif.org/ver10/display/wsdl"; 16 | public const string DOOR_CONTROL = "http://www.onvif.org/ver10/doorcontrol/wsdl"; 17 | public const string EVENTS = "http://www.onvif.org/ver10/events/wsdl"; 18 | public const string IMAGING = "http://www.onvif.org/ver20/imaging/wsdl"; 19 | public const string MEDIA = "http://www.onvif.org/ver10/media/wsdl"; 20 | public const string MEDIA2 = "http://www.onvif.org/ver20/media/wsdl"; 21 | public const string PROVISIONING = "http://www.onvif.org/ver10/provisioning/wsdl"; 22 | public const string PTZ = "http://www.onvif.org/ver20/ptz/wsdl"; 23 | public const string RECEIVER = "http://www.onvif.org/ver10/receiver/wsdl"; 24 | public const string RECORDING = "http://www.onvif.org/ver10/recording/wsdl"; 25 | public const string REPLAY = "http://www.onvif.org/ver10/replay/wsdl"; 26 | public const string SCHEDULE = "http://www.onvif.org/ver10/schedule/wsdl"; 27 | public const string SEARCH = "http://www.onvif.org/ver10/search/wsdl"; 28 | public const string THERMAL = "http://www.onvif.org/ver10/thermal/wsdl"; 29 | public const string UPLINK = "http://www.onvif.org/ver10/uplink/wsdl"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/SharpOnvifCommon/OnvifWsdl.cs: -------------------------------------------------------------------------------- 1 | namespace SharpOnvifCommon 2 | { 3 | public static class OnvifWsdl 4 | { 5 | public const string ACCESS_CONTROL = "https://www.onvif.org/ver10/pacs/accesscontrol.wsdl"; 6 | public const string ACCESS_RULES = "https://www.onvif.org/ver10/accessrules/wsdl/accessrules.wsdl"; 7 | public const string ACTION_ENGINE = "https://www.onvif.org/ver10/actionengine.wsdl"; 8 | public const string ADVANCED_SECURITY = "https://www.onvif.org/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl"; 9 | public const string ANALYTICS = "https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl"; 10 | public const string APP_MGMT = "https://www.onvif.org/ver10/appmgmt/wsdl/appmgmt.wsdl"; 11 | public const string AUTHENTICATION_BEHAVIOR = "https://www.onvif.org/ver10/authenticationbehavior/wsdl/authenticationbehavior.wsdl"; 12 | public const string CREDENTIAL = "https://www.onvif.org/ver10/credential/wsdl/credential.wsdl"; 13 | public const string DEVICE_IO = "https://www.onvif.org/ver10/deviceio.wsdl"; 14 | public const string DEVICE_MGMT = "https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl"; 15 | public const string DISPLAY = "https://www.onvif.org/ver10/display.wsdl"; 16 | public const string DOOR_CONTROL = "https://www.onvif.org/ver10/pacs/doorcontrol.wsdl"; 17 | public const string EVENTS = "https://www.onvif.org/ver10/events/wsdl/event.wsdl"; 18 | public const string IMAGING = "https://www.onvif.org/ver20/imaging/wsdl/imaging.wsdl"; 19 | public const string MEDIA = "https://www.onvif.org/ver10/media/wsdl/media.wsdl"; 20 | public const string MEDIA2 = "https://www.onvif.org/ver20/media/wsdl/media.wsdl"; 21 | public const string PROVISIONING = "https://www.onvif.org/ver10/provisioning/wsdl/provisioning.wsdl"; 22 | public const string PTZ = "https://www.onvif.org/ver20/ptz/wsdl/ptz.wsdl"; 23 | public const string RECEIVER = "https://www.onvif.org/ver10/receiver.wsdl"; 24 | public const string RECORDING = "https://www.onvif.org/ver10/recording.wsdl"; 25 | public const string REPLAY = "https://www.onvif.org/ver10/replay.wsdl"; 26 | public const string SCHEDULE = "https://www.onvif.org/ver10/schedule/wsdl/schedule.wsdl"; 27 | public const string SEARCH = "https://www.onvif.org/ver10/search.wsdl"; 28 | public const string TERMAL = "https://www.onvif.org/ver10/thermal/wsdl/thermal.wsdl"; 29 | public const string UPLINK = "https://www.onvif.org/ver10/uplink/wsdl/uplink.wsdl"; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/SharpOnvifCommon/PTZ/Spaces.cs: -------------------------------------------------------------------------------- 1 | namespace SharpOnvifCommon.PTZ 2 | { 3 | public static class SpacesPanTilt 4 | { 5 | public const string POSITION_GENERIC_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace"; 6 | public const string POSITION_SPHERICAL_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/SphericalPositionSpace"; 7 | public const string POSITION_DIGITAL_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/DigitalPositionSpace"; 8 | public const string TRANSLATION_GENERIC_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace"; 9 | public const string TRANSLATION_SPHERICAL_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/SphericalTranslation"; 10 | public const string TRANSLATION_FOV_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationSpaceFov"; 11 | public const string TRANSLATION_DIGITAL_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/DigitalTranslationSpace"; 12 | public const string VELOCITY_GENERIC_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace"; 13 | public const string VELOCITY_DEGREES_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocitySpaceDegrees"; 14 | public const string VELOCITY_FOV_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocitySpaceFOV"; 15 | public const string SPEED_GENERIC_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace"; 16 | public const string SPEED_DEGREES_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/SpeedSpaceDegrees"; 17 | public const string SPEED_FOV_SPACE = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/SpeedSpaceFOV"; 18 | } 19 | 20 | public static class SpacesZoom 21 | { 22 | public const string POSITION_GENERIC_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace"; 23 | public const string POSITION_MILLIMETER_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionSpaceMillimeter"; 24 | public const string POSITION_DIGITAL_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigitalPosition"; 25 | public const string TRANSLATION_GENERIC_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace"; 26 | public const string TRANSLATION_MILLIMETER_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationSpaceMillimeter"; 27 | public const string TRANSLATION_DIGITAL_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigital"; 28 | public const string VELOCITY_MILLIMETER_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocitySpaceMillimeter"; 29 | public const string VELOCITY_GENERIC_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace"; 30 | public const string VELOCITY_DIGITAL_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigitalVelocity"; 31 | public const string SPEED_GENERIC_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace"; 32 | public const string SPEED_MILLIMETER_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/SpeedSpaceMillimeter"; 33 | public const string SPEED_DIGITAL_SPACE = "http://www.onvif.org/ver10/tptz/ZoomSpaces/NormalizedDigitalSpeedSpace"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/SharpOnvifCommon/Security/DigestHelpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Security.Cryptography; 4 | using System.Text; 5 | 6 | namespace SharpOnvifCommon.Security 7 | { 8 | public static class DigestHelpers 9 | { 10 | public static string CalculateNonce(int length = 32) 11 | { 12 | var byteArray = new byte[length]; 13 | using (var rnd = RandomNumberGenerator.Create()) 14 | { 15 | rnd.GetBytes(byteArray); 16 | } 17 | return Convert.ToBase64String(byteArray); 18 | } 19 | 20 | public static string CreateSoapDigest(string nonce, string created, string password) 21 | { 22 | var nonceBytes = Convert.FromBase64String(nonce); 23 | var createdBytes = Encoding.UTF8.GetBytes(created); 24 | var passwordBytes = Encoding.UTF8.GetBytes(password); 25 | var combined = new byte[createdBytes.Length + nonceBytes.Length + passwordBytes.Length]; 26 | 27 | Buffer.BlockCopy(nonceBytes, 0, combined, 0, nonceBytes.Length); 28 | Buffer.BlockCopy(createdBytes, 0, combined, nonceBytes.Length, createdBytes.Length); 29 | Buffer.BlockCopy(passwordBytes, 0, combined, nonceBytes.Length + createdBytes.Length, passwordBytes.Length); 30 | 31 | using (var sha = SHA1.Create()) 32 | { 33 | return Convert.ToBase64String(sha.ComputeHash(combined)); 34 | } 35 | } 36 | 37 | public static string CreateWebDigestRFC2069(string userName, string realm, string password, string nonce, string method, string uri) 38 | { 39 | string HA1 = GenerateMD5Hash($"{userName}:{realm}:{password}"); 40 | string HA2 = GenerateMD5Hash($"{method}:{uri}"); 41 | string digest = GenerateMD5Hash($"{HA1}:{nonce}:{HA2}"); 42 | return digest; 43 | } 44 | 45 | private static string GenerateMD5Hash(string input) 46 | { 47 | using (MD5 hash = MD5.Create()) 48 | { 49 | return string.Concat(hash.ComputeHash(Encoding.UTF8.GetBytes(input)).Select(x => x.ToString("x2"))); 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/SharpOnvifCommon/Security/Nonce.cs: -------------------------------------------------------------------------------- 1 | using System.Xml.Serialization; 2 | 3 | namespace SharpOnvifCommon.Security 4 | { 5 | [XmlRoot(ElementName = "Nonce", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] 6 | public class Nonce 7 | { 8 | [XmlAttribute(AttributeName = "EncodingType")] 9 | public string EncodingType { get; set; } 10 | 11 | [XmlText] 12 | public string Text { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/SharpOnvifCommon/Security/Password.cs: -------------------------------------------------------------------------------- 1 | using System.Xml.Serialization; 2 | 3 | namespace SharpOnvifCommon.Security 4 | { 5 | [XmlRoot(ElementName = "Password", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] 6 | public class Password 7 | { 8 | [XmlAttribute(AttributeName = "Type")] 9 | public string Type { get; set; } 10 | 11 | [XmlText] 12 | public string Text { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/SharpOnvifCommon/Security/UsernameToken.cs: -------------------------------------------------------------------------------- 1 |  2 | using System.Xml.Serialization; 3 | 4 | namespace SharpOnvifCommon.Security 5 | { 6 | [XmlRoot(ElementName = "UsernameToken", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] 7 | public class UsernameToken 8 | { 9 | [XmlElement(ElementName = "Username", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] 10 | public string Username { get; set; } 11 | 12 | [XmlElement(ElementName = "Password", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] 13 | public Password Password { get; set; } 14 | 15 | [XmlElement(ElementName = "Nonce", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")] 16 | public Nonce Nonce { get; set; } 17 | 18 | [XmlElement(ElementName = "Created", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] 19 | public string Created { get; set; } 20 | 21 | [XmlAttribute(AttributeName = "Id", Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")] 22 | public string Id { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/SharpOnvifCommon/SharpOnvifCommon.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0;net481;net8.0 5 | false 6 | false 7 | $([System.Text.RegularExpressions.Regex]::Replace(@(ReferencePath), `(?'pre'[\\/])ref(?'post'[\\/](netstandard|netcoreapp|net)\d+(\.\d+)*[\\/])`, `${pre}lib${post}`)) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AccessControl/SharpOnvifServer.AccessControl.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AccessRules/AccessRulesPortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.AccessRules 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class AccessRulesPortBase : AccessRulesPort 9 | { 10 | [return: MessageParameter(Name = "Token")] 11 | public virtual string CreateAccessProfile(AccessProfile AccessProfile) 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | public virtual void DeleteAccessProfile(string Token) 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | 21 | [return: MessageParameter(Name = "AccessProfileInfo")] 22 | public virtual GetAccessProfileInfoResponse GetAccessProfileInfo(GetAccessProfileInfoRequest request) 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | 27 | public virtual GetAccessProfileInfoListResponse GetAccessProfileInfoList(GetAccessProfileInfoListRequest request) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | 32 | public virtual GetAccessProfileListResponse GetAccessProfileList(GetAccessProfileListRequest request) 33 | { 34 | throw new NotImplementedException(); 35 | } 36 | 37 | [return: MessageParameter(Name = "AccessProfile")] 38 | public virtual GetAccessProfilesResponse GetAccessProfiles(GetAccessProfilesRequest request) 39 | { 40 | throw new NotImplementedException(); 41 | } 42 | 43 | [return: MessageParameter(Name = "Capabilities")] 44 | public virtual ServiceCapabilities GetServiceCapabilities() 45 | { 46 | throw new NotImplementedException(); 47 | } 48 | 49 | public virtual void ModifyAccessProfile(AccessProfile AccessProfile) 50 | { 51 | throw new NotImplementedException(); 52 | } 53 | 54 | public virtual void SetAccessProfile(AccessProfile AccessProfile) 55 | { 56 | throw new NotImplementedException(); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AccessRules/SharpOnvifServer.AccessRules.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.ActionEngine/ActionEnginePortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.ActionEngine 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class ActionEnginePortBase : ActionEnginePort 9 | { 10 | public virtual CreateActionsResponse CreateActions(CreateActionsRequest request) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public virtual CreateActionTriggersResponse CreateActionTriggers(CreateActionTriggersRequest request) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | public virtual DeleteActionsResponse DeleteActions(DeleteActionsRequest request) 21 | { 22 | throw new NotImplementedException(); 23 | } 24 | 25 | public virtual DeleteActionTriggersResponse DeleteActionTriggers(DeleteActionTriggersRequest request) 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | 30 | [return: MessageParameter(Name = "Action")] 31 | public virtual GetActionsResponse GetActions(GetActionsRequest request) 32 | { 33 | throw new NotImplementedException(); 34 | } 35 | 36 | [return: MessageParameter(Name = "ActionTrigger")] 37 | public virtual GetActionTriggersResponse GetActionTriggers(GetActionTriggersRequest request) 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | 42 | [return: MessageParameter(Name = "Capabilities")] 43 | public virtual ActionEngineCapabilities GetServiceCapabilities() 44 | { 45 | throw new NotImplementedException(); 46 | } 47 | 48 | [return: MessageParameter(Name = "SupportedActions")] 49 | public virtual SupportedActions GetSupportedActions() 50 | { 51 | throw new NotImplementedException(); 52 | } 53 | 54 | public virtual ModifyActionsResponse ModifyActions(ModifyActionsRequest request) 55 | { 56 | throw new NotImplementedException(); 57 | } 58 | 59 | public virtual ModifyActionTriggersResponse ModifyActionTriggers(ModifyActionTriggersRequest request) 60 | { 61 | throw new NotImplementedException(); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.ActionEngine/SharpOnvifServer.ActionEngine.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AdvancedSecurity/AdvancedSecurityServiceBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.AdvancedSecurity 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class AdvancedSecurityServiceBase : AdvancedSecurityService 9 | { 10 | [return: MessageParameter(Name = "Capabilities")] 11 | public virtual Capabilities GetServiceCapabilities() 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AdvancedSecurity/AuthorizationServerBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.AdvancedSecurity 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class AuthorizationServerBase : AuthorizationServer 9 | { 10 | [return: MessageParameter(Name = "Token")] 11 | public virtual string CreateAuthorizationServerConfiguration(AuthorizationServerConfigurationData Configuration) 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | public virtual void DeleteAuthorizationServerConfiguration(string Token) 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | 21 | [return: MessageParameter(Name = "Configuration")] 22 | public virtual GetAuthorizationServerConfigurationsResponse GetAuthorizationServerConfigurations(GetAuthorizationServerConfigurationsRequest request) 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | 27 | public virtual void SetAuthorizationServerConfiguration(AuthorizationServerConfiguration Configuration) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AdvancedSecurity/Dot1XBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.AdvancedSecurity 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class Dot1XBase : Dot1X 9 | { 10 | [return: MessageParameter(Name = "Dot1XID")] 11 | public virtual AddDot1XConfigurationResponse AddDot1XConfiguration(AddDot1XConfigurationRequest request) 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | public virtual DeleteDot1XConfigurationResponse DeleteDot1XConfiguration(DeleteDot1XConfigurationRequest request) 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | 21 | [return: MessageParameter(Name = "RebootNeeded")] 22 | public virtual bool DeleteNetworkInterfaceDot1XConfiguration(string token) 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | 27 | [return: MessageParameter(Name = "Configuration")] 28 | public virtual GetAllDot1XConfigurationsResponse GetAllDot1XConfigurations(GetAllDot1XConfigurationsRequest request) 29 | { 30 | throw new NotImplementedException(); 31 | } 32 | 33 | [return: MessageParameter(Name = "Dot1XConfiguration")] 34 | public virtual GetDot1XConfigurationResponse GetDot1XConfiguration(GetDot1XConfigurationRequest request) 35 | { 36 | throw new NotImplementedException(); 37 | } 38 | 39 | [return: MessageParameter(Name = "Dot1XID")] 40 | public virtual GetNetworkInterfaceDot1XConfigurationResponse GetNetworkInterfaceDot1XConfiguration(GetNetworkInterfaceDot1XConfigurationRequest request) 41 | { 42 | throw new NotImplementedException(); 43 | } 44 | 45 | [return: MessageParameter(Name = "RebootNeeded")] 46 | public virtual SetNetworkInterfaceDot1XConfigurationResponse SetNetworkInterfaceDot1XConfiguration(SetNetworkInterfaceDot1XConfigurationRequest request) 47 | { 48 | throw new NotImplementedException(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AdvancedSecurity/JWTBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.AdvancedSecurity 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class JWTBase : JWT 9 | { 10 | [return: MessageParameter(Name = "Configuration")] 11 | public virtual JWTConfiguration GetJWTConfiguration() 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | public virtual void SetJWTConfiguration(JWTConfiguration Configuration) 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AdvancedSecurity/SharpOnvifServer.AdvancedSecurity.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AdvancedSecurity/TLSServerBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.AdvancedSecurity 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class TLSServerBase : TLSServer 9 | { 10 | public virtual AddCertPathValidationPolicyAssignmentResponse AddCertPathValidationPolicyAssignment(AddCertPathValidationPolicyAssignmentRequest request) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public virtual AddServerCertificateAssignmentResponse AddServerCertificateAssignment(AddServerCertificateAssignmentRequest request) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | [return: MessageParameter(Name = "CertPathValidationPolicyID")] 21 | public virtual GetAssignedCertPathValidationPoliciesResponse GetAssignedCertPathValidationPolicies(GetAssignedCertPathValidationPoliciesRequest request) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | 26 | [return: MessageParameter(Name = "CertificationPathID")] 27 | public virtual GetAssignedServerCertificatesResponse GetAssignedServerCertificates(GetAssignedServerCertificatesRequest request) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | 32 | [return: MessageParameter(Name = "clientAuthenticationRequired")] 33 | public virtual bool GetClientAuthenticationRequired() 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | 38 | [return: MessageParameter(Name = "cnMapsToUser")] 39 | public virtual bool GetCnMapsToUser() 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | 44 | [return: MessageParameter(Name = "Versions")] 45 | public virtual string GetEnabledTLSVersions() 46 | { 47 | throw new NotImplementedException(); 48 | } 49 | 50 | public virtual RemoveCertPathValidationPolicyAssignmentResponse RemoveCertPathValidationPolicyAssignment(RemoveCertPathValidationPolicyAssignmentRequest request) 51 | { 52 | throw new NotImplementedException(); 53 | } 54 | 55 | public virtual RemoveServerCertificateAssignmentResponse RemoveServerCertificateAssignment(RemoveServerCertificateAssignmentRequest request) 56 | { 57 | throw new NotImplementedException(); 58 | } 59 | 60 | public virtual ReplaceCertPathValidationPolicyAssignmentResponse ReplaceCertPathValidationPolicyAssignment(ReplaceCertPathValidationPolicyAssignmentRequest request) 61 | { 62 | throw new NotImplementedException(); 63 | } 64 | 65 | public virtual ReplaceServerCertificateAssignmentResponse ReplaceServerCertificateAssignment(ReplaceServerCertificateAssignmentRequest request) 66 | { 67 | throw new NotImplementedException(); 68 | } 69 | 70 | public virtual void SetClientAuthenticationRequired(bool clientAuthenticationRequired) 71 | { 72 | throw new NotImplementedException(); 73 | } 74 | 75 | public virtual void SetCnMapsToUser(bool cnMapsToUser) 76 | { 77 | throw new NotImplementedException(); 78 | } 79 | 80 | public virtual void SetEnabledTLSVersions(string Versions) 81 | { 82 | throw new NotImplementedException(); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Analytics/AnalyticsEnginePortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Analytics 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class AnalyticsEnginePortBase : AnalyticsEnginePort 9 | { 10 | public virtual CreateAnalyticsModulesResponse CreateAnalyticsModules(CreateAnalyticsModulesRequest request) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public virtual DeleteAnalyticsModulesResponse DeleteAnalyticsModules(DeleteAnalyticsModulesRequest request) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | [return: MessageParameter(Name = "Options")] 21 | public virtual GetAnalyticsModuleOptionsResponse GetAnalyticsModuleOptions(GetAnalyticsModuleOptionsRequest request) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | 26 | [return: MessageParameter(Name = "AnalyticsModule")] 27 | public virtual GetAnalyticsModulesResponse GetAnalyticsModules(GetAnalyticsModulesRequest request) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | 32 | [return: MessageParameter(Name = "Capabilities")] 33 | public virtual Capabilities GetServiceCapabilities() 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | 38 | [return: MessageParameter(Name = "SupportedAnalyticsModules")] 39 | public virtual SupportedAnalyticsModules GetSupportedAnalyticsModules(string ConfigurationToken) 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | 44 | [return: MessageParameter(Name = "AnalyticsModule")] 45 | public virtual GetSupportedMetadataResponse GetSupportedMetadata(GetSupportedMetadataRequest request) 46 | { 47 | throw new NotImplementedException(); 48 | } 49 | 50 | public virtual ModifyAnalyticsModulesResponse ModifyAnalyticsModules(ModifyAnalyticsModulesRequest request) 51 | { 52 | throw new NotImplementedException(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Analytics/Patch.cs: -------------------------------------------------------------------------------- 1 | namespace SharpOnvifServer.Analytics 2 | { 3 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 4 | public partial class Behaviour1 5 | { } 6 | 7 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 8 | public partial class Capabilities1 9 | { } 10 | 11 | [System.Xml.Serialization.XmlRoot(Namespace = "http://docs.oasis-open.org/wsn/b-2")] 12 | public partial class QueryExpressionType1 13 | { } 14 | } 15 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Analytics/RuleEnginePortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Analytics 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class RuleEnginePortBase : RuleEnginePort 9 | { 10 | public virtual CreateRulesResponse CreateRules(CreateRulesRequest request) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public virtual DeleteRulesResponse DeleteRules(DeleteRulesRequest request) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | [return: MessageParameter(Name = "RuleOptions")] 21 | public virtual GetRuleOptionsResponse GetRuleOptions(GetRuleOptionsRequest request) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | 26 | [return: MessageParameter(Name = "Rule")] 27 | public virtual GetRulesResponse GetRules(GetRulesRequest request) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | 32 | [return: MessageParameter(Name = "SupportedRules")] 33 | public virtual SupportedRules GetSupportedRules(string ConfigurationToken) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | 38 | public virtual ModifyRulesResponse ModifyRules(ModifyRulesRequest request) 39 | { 40 | throw new NotImplementedException(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Analytics/SharpOnvifServer.Analytics.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AppMgmt/AppManagementBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.AppMgmt 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class AppManagementBase : AppManagement 9 | { 10 | public virtual ActivateResponse Activate(ActivateRequest request) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public virtual DeactivateResponse Deactivate(DeactivateRequest request) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | [return: MessageParameter(Name = "Info")] 21 | public virtual GetAppsInfoResponse GetAppsInfo(GetAppsInfoRequest request) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | 26 | [return: MessageParameter(Name = "DeviceId")] 27 | public virtual GetDeviceIdResponse GetDeviceId(GetDeviceIdRequest request) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | 32 | [return: MessageParameter(Name = "App")] 33 | public virtual GetInstalledAppsResponse GetInstalledApps(GetInstalledAppsRequest request) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | 38 | [return: MessageParameter(Name = "Capabilities")] 39 | public virtual GetServiceCapabilitiesResponse GetServiceCapabilities(GetServiceCapabilitiesRequest request) 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | 44 | public virtual InstallLicenseResponse InstallLicense(InstallLicenseRequest request) 45 | { 46 | throw new NotImplementedException(); 47 | } 48 | 49 | public virtual UninstallResponse Uninstall(UninstallRequest request) 50 | { 51 | throw new NotImplementedException(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AppMgmt/SharpOnvifServer.AppMgmt.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AuthenticationBehavior/AuthenticationBehaviorPortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.AuthenticationBehavior 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class AuthenticationBehaviorPortBase : AuthenticationBehaviorPort 9 | { 10 | [return: MessageParameter(Name = "Token")] 11 | public virtual string CreateAuthenticationProfile(AuthenticationProfile AuthenticationProfile) 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | [return: MessageParameter(Name = "Token")] 17 | public virtual string CreateSecurityLevel(SecurityLevel SecurityLevel) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | 22 | public virtual void DeleteAuthenticationProfile(string Token) 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | 27 | public virtual void DeleteSecurityLevel(string Token) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | 32 | [return: MessageParameter(Name = "AuthenticationProfileInfo")] 33 | public virtual GetAuthenticationProfileInfoResponse GetAuthenticationProfileInfo(GetAuthenticationProfileInfoRequest request) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | 38 | public virtual GetAuthenticationProfileInfoListResponse GetAuthenticationProfileInfoList(GetAuthenticationProfileInfoListRequest request) 39 | { 40 | throw new NotImplementedException(); 41 | } 42 | 43 | public virtual GetAuthenticationProfileListResponse GetAuthenticationProfileList(GetAuthenticationProfileListRequest request) 44 | { 45 | throw new NotImplementedException(); 46 | } 47 | 48 | [return: MessageParameter(Name = "AuthenticationProfile")] 49 | public virtual GetAuthenticationProfilesResponse GetAuthenticationProfiles(GetAuthenticationProfilesRequest request) 50 | { 51 | throw new NotImplementedException(); 52 | } 53 | 54 | [return: MessageParameter(Name = "SecurityLevelInfo")] 55 | public virtual GetSecurityLevelInfoResponse GetSecurityLevelInfo(GetSecurityLevelInfoRequest request) 56 | { 57 | throw new NotImplementedException(); 58 | } 59 | 60 | public virtual GetSecurityLevelInfoListResponse GetSecurityLevelInfoList(GetSecurityLevelInfoListRequest request) 61 | { 62 | throw new NotImplementedException(); 63 | } 64 | 65 | public virtual GetSecurityLevelListResponse GetSecurityLevelList(GetSecurityLevelListRequest request) 66 | { 67 | throw new NotImplementedException(); 68 | } 69 | 70 | [return: MessageParameter(Name = "SecurityLevel")] 71 | public virtual GetSecurityLevelsResponse GetSecurityLevels(GetSecurityLevelsRequest request) 72 | { 73 | throw new NotImplementedException(); 74 | } 75 | 76 | [return: MessageParameter(Name = "Capabilities")] 77 | public virtual ServiceCapabilities GetServiceCapabilities() 78 | { 79 | throw new NotImplementedException(); 80 | } 81 | 82 | public virtual void ModifyAuthenticationProfile(AuthenticationProfile AuthenticationProfile) 83 | { 84 | throw new NotImplementedException(); 85 | } 86 | 87 | public virtual void ModifySecurityLevel(SecurityLevel SecurityLevel) 88 | { 89 | throw new NotImplementedException(); 90 | } 91 | 92 | public virtual void SetAuthenticationProfile(AuthenticationProfile AuthenticationProfile) 93 | { 94 | throw new NotImplementedException(); 95 | } 96 | 97 | public virtual void SetSecurityLevel(SecurityLevel SecurityLevel) 98 | { 99 | throw new NotImplementedException(); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.AuthenticationBehavior/SharpOnvifServer.AuthenticationBehavior.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Credential/SharpOnvifServer.Credential.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.DeviceIO/SharpOnvifServer.DeviceIO.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.DeviceMgmt/Patch.cs: -------------------------------------------------------------------------------- 1 | namespace SharpOnvifServer.DeviceMgmt 2 | { 3 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 4 | public partial class SystemCapabilities1 5 | { } 6 | 7 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 8 | public partial class SecurityCapabilities1 9 | { } 10 | 11 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 12 | public partial class NetworkCapabilities1 13 | { } 14 | } 15 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.DeviceMgmt/SharpOnvifServer.DeviceMgmt.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Display/DisplayPortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Display 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class DisplayPortBase : DisplayPort 9 | { 10 | public virtual CreatePaneConfigurationResponse CreatePaneConfiguration(CreatePaneConfigurationRequest request) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public virtual DeletePaneConfigurationResponse DeletePaneConfiguration(DeletePaneConfigurationRequest request) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | public virtual GetDisplayOptionsResponse GetDisplayOptions(GetDisplayOptionsRequest request) 21 | { 22 | throw new NotImplementedException(); 23 | } 24 | 25 | public virtual GetLayoutResponse GetLayout(GetLayoutRequest request) 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | 30 | public virtual GetPaneConfigurationResponse GetPaneConfiguration(GetPaneConfigurationRequest request) 31 | { 32 | throw new NotImplementedException(); 33 | } 34 | 35 | [return: MessageParameter(Name = "PaneConfiguration")] 36 | public virtual GetPaneConfigurationsResponse GetPaneConfigurations(GetPaneConfigurationsRequest request) 37 | { 38 | throw new NotImplementedException(); 39 | } 40 | 41 | [return: MessageParameter(Name = "Capabilities")] 42 | public virtual Capabilities GetServiceCapabilities() 43 | { 44 | throw new NotImplementedException(); 45 | } 46 | 47 | public virtual SetLayoutResponse SetLayout(SetLayoutRequest request) 48 | { 49 | throw new NotImplementedException(); 50 | } 51 | 52 | public virtual SetPaneConfigurationResponse SetPaneConfiguration(SetPaneConfigurationRequest request) 53 | { 54 | throw new NotImplementedException(); 55 | } 56 | 57 | [return: MessageParameter(Name = "Any")] 58 | public virtual SetPaneConfigurationsResponse SetPaneConfigurations(SetPaneConfigurationsRequest request) 59 | { 60 | throw new NotImplementedException(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Display/SharpOnvifServer.Display.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.DoorControl/DoorControlPortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.DoorControl 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class DoorControlPortBase : DoorControlPort 9 | { 10 | public virtual AccessDoorResponse AccessDoor(AccessDoorRequest request) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public virtual void BlockDoor(string Token) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | [return: MessageParameter(Name = "Token")] 21 | public virtual string CreateDoor(Door Door) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | 26 | public virtual void DeleteDoor(string Token) 27 | { 28 | throw new NotImplementedException(); 29 | } 30 | 31 | public virtual void DoubleLockDoor(string Token) 32 | { 33 | throw new NotImplementedException(); 34 | } 35 | 36 | [return: MessageParameter(Name = "DoorInfo")] 37 | public virtual GetDoorInfoResponse GetDoorInfo(GetDoorInfoRequest request) 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | 42 | public virtual GetDoorInfoListResponse GetDoorInfoList(GetDoorInfoListRequest request) 43 | { 44 | throw new NotImplementedException(); 45 | } 46 | 47 | public virtual GetDoorListResponse GetDoorList(GetDoorListRequest request) 48 | { 49 | throw new NotImplementedException(); 50 | } 51 | 52 | [return: MessageParameter(Name = "Door")] 53 | public virtual GetDoorsResponse GetDoors(GetDoorsRequest request) 54 | { 55 | throw new NotImplementedException(); 56 | } 57 | 58 | [return: MessageParameter(Name = "DoorState")] 59 | public virtual DoorState GetDoorState(string Token) 60 | { 61 | throw new NotImplementedException(); 62 | } 63 | 64 | [return: MessageParameter(Name = "Capabilities")] 65 | public virtual ServiceCapabilities GetServiceCapabilities() 66 | { 67 | throw new NotImplementedException(); 68 | } 69 | 70 | public virtual void LockDoor(string Token) 71 | { 72 | throw new NotImplementedException(); 73 | } 74 | 75 | public virtual void LockDownDoor(string Token) 76 | { 77 | throw new NotImplementedException(); 78 | } 79 | 80 | public virtual void LockDownReleaseDoor(string Token) 81 | { 82 | throw new NotImplementedException(); 83 | } 84 | 85 | public virtual void LockOpenDoor(string Token) 86 | { 87 | throw new NotImplementedException(); 88 | } 89 | 90 | public virtual void LockOpenReleaseDoor(string Token) 91 | { 92 | throw new NotImplementedException(); 93 | } 94 | 95 | public virtual void ModifyDoor(Door Door) 96 | { 97 | throw new NotImplementedException(); 98 | } 99 | 100 | public virtual void SetDoor(Door Door) 101 | { 102 | throw new NotImplementedException(); 103 | } 104 | 105 | public virtual void UnlockDoor(string Token) 106 | { 107 | throw new NotImplementedException(); 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.DoorControl/SharpOnvifServer.DoorControl.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Events/EventsBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Events 6 | { 7 | /// 8 | /// Contains default implemetation of all event interfaces. 9 | /// 10 | /// 11 | /// Because of CoreWCF limitations when multiple services cannot share the binding URI, we have to implement all interfaces that 12 | /// should be available on a single endpoint here. 13 | /// 14 | [DisableMustUnderstandValidation] 15 | public class EventsBase : NotificationProducer, EventPortType, PullPoint 16 | { 17 | #region NotificationProducer 18 | 19 | public virtual GetCurrentMessageResponse1 GetCurrentMessage(GetCurrentMessageRequest request) 20 | { 21 | throw new NotImplementedException(); 22 | } 23 | 24 | public virtual SubscribeResponse1 Subscribe(SubscribeRequest request) 25 | { 26 | throw new NotImplementedException(); 27 | } 28 | 29 | #endregion // NotificationProducer 30 | 31 | #region EventPortType 32 | 33 | public virtual void AddEventBroker(EventBrokerConfig EventBroker) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | 38 | public virtual CreatePullPointSubscriptionResponse CreatePullPointSubscription(CreatePullPointSubscriptionRequest request) 39 | { 40 | throw new NotImplementedException(); 41 | } 42 | 43 | public virtual DeleteEventBrokerResponse DeleteEventBroker(DeleteEventBrokerRequest request) 44 | { 45 | throw new NotImplementedException(); 46 | } 47 | 48 | [return: MessageParameter(Name = "EventBroker")] 49 | public virtual GetEventBrokersResponse GetEventBrokers(GetEventBrokersRequest request) 50 | { 51 | throw new NotImplementedException(); 52 | } 53 | 54 | public virtual GetEventPropertiesResponse GetEventProperties(GetEventPropertiesRequest request) 55 | { 56 | throw new NotImplementedException(); 57 | } 58 | 59 | [return: MessageParameter(Name = "Capabilities")] 60 | public virtual Capabilities GetServiceCapabilities() 61 | { 62 | throw new NotImplementedException(); 63 | } 64 | 65 | #endregion // EventPortType 66 | 67 | #region PullPoint 68 | 69 | public virtual DestroyPullPointResponse1 DestroyPullPoint(DestroyPullPointRequest request) 70 | { 71 | throw new NotImplementedException(); 72 | } 73 | 74 | public virtual GetMessagesResponse1 GetMessages(GetMessagesRequest request) 75 | { 76 | throw new NotImplementedException(); 77 | } 78 | 79 | public virtual void Notify(Notify1 request) 80 | { 81 | throw new NotImplementedException(); 82 | } 83 | 84 | #endregion // PullPoint 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Events/NotificationConsumerBase.cs: -------------------------------------------------------------------------------- 1 | using SharpOnvifServer.Security; 2 | using System; 3 | 4 | namespace SharpOnvifServer.Events 5 | { 6 | [DisableMustUnderstandValidation] 7 | public class NotificationConsumerBase : NotificationConsumer 8 | { 9 | public virtual void Notify(Notify1 request) 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Events/SharpOnvifServer.Events.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Events/SubscriptionManagerBase.cs: -------------------------------------------------------------------------------- 1 | using SharpOnvifServer.Security; 2 | using System; 3 | 4 | namespace SharpOnvifServer.Events 5 | { 6 | [DisableMustUnderstandValidation] 7 | public class SubscriptionManagerBase : SubscriptionManager, PausableSubscriptionManager, PullPointSubscription 8 | { 9 | #region SubscriptionManager 10 | 11 | public virtual RenewResponse1 Renew(RenewRequest request) 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | public virtual UnsubscribeResponse1 Unsubscribe(UnsubscribeRequest request) 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | 21 | #endregion // SubscriptionManager 22 | 23 | #region PausableSubscriptionManager 24 | 25 | public virtual PauseSubscriptionResponse1 PauseSubscription(PauseSubscriptionRequest request) 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | 30 | public virtual ResumeSubscriptionResponse1 ResumeSubscription(ResumeSubscriptionRequest request) 31 | { 32 | throw new NotImplementedException(); 33 | } 34 | 35 | #endregion // PausableSubscriptionManager 36 | 37 | #region PullPointSubscription 38 | 39 | public virtual PullMessagesResponse PullMessages(PullMessagesRequest request) 40 | { 41 | throw new System.NotImplementedException(); 42 | } 43 | 44 | public virtual SeekResponse Seek(SeekRequest request) 45 | { 46 | throw new System.NotImplementedException(); 47 | } 48 | 49 | public virtual void SetSynchronizationPoint() 50 | { 51 | throw new System.NotImplementedException(); 52 | } 53 | 54 | #endregion // PullPointSubscription 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Imaging/ImagingPortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Imaging 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class ImagingPortBase : ImagingPort 9 | { 10 | [return: MessageParameter(Name = "Preset")] 11 | public virtual ImagingPreset GetCurrentPreset(string VideoSourceToken) 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | [return: MessageParameter(Name = "ImagingSettings")] 17 | public virtual ImagingSettings20 GetImagingSettings(string VideoSourceToken) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | 22 | [return: MessageParameter(Name = "MoveOptions")] 23 | public virtual MoveOptions20 GetMoveOptions(string VideoSourceToken) 24 | { 25 | throw new NotImplementedException(); 26 | } 27 | 28 | [return: MessageParameter(Name = "ImagingOptions")] 29 | public virtual ImagingOptions20 GetOptions(string VideoSourceToken) 30 | { 31 | throw new NotImplementedException(); 32 | } 33 | 34 | [return: MessageParameter(Name = "Preset")] 35 | public virtual GetPresetsResponse GetPresets(GetPresetsRequest request) 36 | { 37 | throw new NotImplementedException(); 38 | } 39 | 40 | [return: MessageParameter(Name = "Capabilities")] 41 | public virtual Capabilities GetServiceCapabilities() 42 | { 43 | throw new NotImplementedException(); 44 | } 45 | 46 | [return: MessageParameter(Name = "Status")] 47 | public virtual ImagingStatus20 GetStatus(string VideoSourceToken) 48 | { 49 | throw new NotImplementedException(); 50 | } 51 | 52 | public virtual void Move(string VideoSourceToken, FocusMove Focus) 53 | { 54 | throw new NotImplementedException(); 55 | } 56 | 57 | public virtual void SetCurrentPreset(string VideoSourceToken, string PresetToken) 58 | { 59 | throw new NotImplementedException(); 60 | } 61 | 62 | public virtual void SetImagingSettings(string VideoSourceToken, ImagingSettings20 ImagingSettings, bool ForcePersistence) 63 | { 64 | throw new NotImplementedException(); 65 | } 66 | 67 | public virtual void Stop(string VideoSourceToken) 68 | { 69 | throw new NotImplementedException(); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Imaging/SharpOnvifServer.Imaging.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Media/SharpOnvifServer.Media.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Media2/Patch.cs: -------------------------------------------------------------------------------- 1 | namespace SharpOnvifServer.Media2 2 | { 3 | [System.Xml.Serialization.XmlRoot(Namespace = "http://www.onvif.org/ver10/schema")] 4 | public partial class ReceiverConfiguration 5 | { } 6 | } 7 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Media2/SharpOnvifServer.Media2.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.PTZ/SharpOnvifServer.PTZ.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Provisioning/ProvisioningServiceBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Provisioning 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class ProvisioningServiceBase : ProvisioningService 9 | { 10 | public virtual FocusMoveResponse FocusMove(FocusMoveRequest request) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | [return: MessageParameter(Name = "Capabilities")] 16 | public virtual Capabilities GetServiceCapabilities() 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | 21 | [return: MessageParameter(Name = "Usage")] 22 | public virtual Usage GetUsage(string VideoSource) 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | 27 | public virtual PanMoveResponse PanMove(PanMoveRequest request) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | 32 | public virtual RollMoveResponse RollMove(RollMoveRequest request) 33 | { 34 | throw new NotImplementedException(); 35 | } 36 | 37 | public virtual void Stop(string VideoSource) 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | 42 | public virtual TiltMoveResponse TiltMove(TiltMoveRequest request) 43 | { 44 | throw new NotImplementedException(); 45 | } 46 | 47 | public virtual ZoomMoveResponse ZoomMove(ZoomMoveRequest request) 48 | { 49 | throw new NotImplementedException(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Provisioning/SharpOnvifServer.Provisioning.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Receiver/ReceiverPortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Receiver 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class ReceiverPortBase : ReceiverPort 9 | { 10 | public virtual void ConfigureReceiver(string ReceiverToken, ReceiverConfiguration Configuration) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | [return: MessageParameter(Name = "Receiver")] 16 | public virtual Receiver CreateReceiver(ReceiverConfiguration Configuration) 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | 21 | public virtual void DeleteReceiver(string ReceiverToken) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | 26 | [return: MessageParameter(Name = "Receiver")] 27 | public virtual Receiver GetReceiver(string ReceiverToken) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | 32 | [return: MessageParameter(Name = "Receivers")] 33 | public virtual GetReceiversResponse GetReceivers(GetReceiversRequest request) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | 38 | [return: MessageParameter(Name = "ReceiverState")] 39 | public virtual ReceiverStateInformation GetReceiverState(string ReceiverToken) 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | 44 | [return: MessageParameter(Name = "Capabilities")] 45 | public virtual Capabilities GetServiceCapabilities() 46 | { 47 | throw new NotImplementedException(); 48 | } 49 | 50 | public virtual void SetReceiverMode(string ReceiverToken, ReceiverMode Mode) 51 | { 52 | throw new NotImplementedException(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Receiver/SharpOnvifServer.Receiver.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Recording/SharpOnvifServer.Recording.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Replay/ReplayPortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Replay 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class ReplayPortBase : ReplayPort 9 | { 10 | [return: MessageParameter(Name = "Configuration")] 11 | public virtual ReplayConfiguration GetReplayConfiguration() 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | [return: MessageParameter(Name = "Uri")] 17 | public virtual GetReplayUriResponse GetReplayUri(GetReplayUriRequest request) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | 22 | [return: MessageParameter(Name = "Capabilities")] 23 | public virtual Capabilities GetServiceCapabilities() 24 | { 25 | throw new NotImplementedException(); 26 | } 27 | 28 | public virtual void SetReplayConfiguration(ReplayConfiguration Configuration) 29 | { 30 | throw new NotImplementedException(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Replay/SharpOnvifServer.Replay.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Schedule/SchedulePortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Schedule 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class SchedulePortBase : SchedulePort 9 | { 10 | [return: MessageParameter(Name = "Token")] 11 | public virtual string CreateSchedule(Schedule Schedule) 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | [return: MessageParameter(Name = "Token")] 17 | public virtual string CreateSpecialDayGroup(SpecialDayGroup SpecialDayGroup) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | 22 | public virtual void DeleteSchedule(string Token) 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | 27 | public virtual void DeleteSpecialDayGroup(string Token) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | 32 | [return: MessageParameter(Name = "ScheduleInfo")] 33 | public virtual GetScheduleInfoResponse GetScheduleInfo(GetScheduleInfoRequest request) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | 38 | public virtual GetScheduleInfoListResponse GetScheduleInfoList(GetScheduleInfoListRequest request) 39 | { 40 | throw new NotImplementedException(); 41 | } 42 | 43 | public virtual GetScheduleListResponse GetScheduleList(GetScheduleListRequest request) 44 | { 45 | throw new NotImplementedException(); 46 | } 47 | 48 | [return: MessageParameter(Name = "Schedule")] 49 | public virtual GetSchedulesResponse GetSchedules(GetSchedulesRequest request) 50 | { 51 | throw new NotImplementedException(); 52 | } 53 | 54 | [return: MessageParameter(Name = "ScheduleState")] 55 | public virtual ScheduleState GetScheduleState(string Token) 56 | { 57 | throw new NotImplementedException(); 58 | } 59 | 60 | [return: MessageParameter(Name = "Capabilities")] 61 | public virtual ServiceCapabilities GetServiceCapabilities() 62 | { 63 | throw new NotImplementedException(); 64 | } 65 | 66 | [return: MessageParameter(Name = "SpecialDayGroupInfo")] 67 | public virtual GetSpecialDayGroupInfoResponse GetSpecialDayGroupInfo(GetSpecialDayGroupInfoRequest request) 68 | { 69 | throw new NotImplementedException(); 70 | } 71 | 72 | public virtual GetSpecialDayGroupInfoListResponse GetSpecialDayGroupInfoList(GetSpecialDayGroupInfoListRequest request) 73 | { 74 | throw new NotImplementedException(); 75 | } 76 | 77 | public virtual GetSpecialDayGroupListResponse GetSpecialDayGroupList(GetSpecialDayGroupListRequest request) 78 | { 79 | throw new NotImplementedException(); 80 | } 81 | 82 | [return: MessageParameter(Name = "SpecialDayGroup")] 83 | public virtual GetSpecialDayGroupsResponse GetSpecialDayGroups(GetSpecialDayGroupsRequest request) 84 | { 85 | throw new NotImplementedException(); 86 | } 87 | 88 | public virtual void ModifySchedule(Schedule Schedule) 89 | { 90 | throw new NotImplementedException(); 91 | } 92 | 93 | public virtual void ModifySpecialDayGroup(SpecialDayGroup SpecialDayGroup) 94 | { 95 | throw new NotImplementedException(); 96 | } 97 | 98 | public virtual void SetSchedule(Schedule Schedule) 99 | { 100 | throw new NotImplementedException(); 101 | } 102 | 103 | public virtual void SetSpecialDayGroup(SpecialDayGroup SpecialDayGroup) 104 | { 105 | throw new NotImplementedException(); 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Schedule/SharpOnvifServer.Schedule.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Search/SearchPortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Search 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class SearchPortBase : SearchPort 9 | { 10 | [return: MessageParameter(Name = "Endpoint")] 11 | public virtual DateTime EndSearch(string SearchToken) 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | [return: MessageParameter(Name = "SearchToken")] 17 | public virtual FindEventsResponse FindEvents(FindEventsRequest request) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | 22 | [return: MessageParameter(Name = "SearchToken")] 23 | public virtual FindMetadataResponse FindMetadata(FindMetadataRequest request) 24 | { 25 | throw new NotImplementedException(); 26 | } 27 | 28 | [return: MessageParameter(Name = "SearchToken")] 29 | public virtual FindPTZPositionResponse FindPTZPosition(FindPTZPositionRequest request) 30 | { 31 | throw new NotImplementedException(); 32 | } 33 | 34 | [return: MessageParameter(Name = "SearchToken")] 35 | public virtual FindRecordingsResponse FindRecordings(FindRecordingsRequest request) 36 | { 37 | throw new NotImplementedException(); 38 | } 39 | 40 | [return: MessageParameter(Name = "ResultList")] 41 | public virtual GetEventSearchResultsResponse GetEventSearchResults(GetEventSearchResultsRequest request) 42 | { 43 | throw new NotImplementedException(); 44 | } 45 | 46 | [return: MessageParameter(Name = "MediaAttributes")] 47 | public virtual GetMediaAttributesResponse GetMediaAttributes(GetMediaAttributesRequest request) 48 | { 49 | throw new NotImplementedException(); 50 | } 51 | 52 | [return: MessageParameter(Name = "ResultList")] 53 | public virtual GetMetadataSearchResultsResponse GetMetadataSearchResults(GetMetadataSearchResultsRequest request) 54 | { 55 | throw new NotImplementedException(); 56 | } 57 | 58 | [return: MessageParameter(Name = "ResultList")] 59 | public virtual GetPTZPositionSearchResultsResponse GetPTZPositionSearchResults(GetPTZPositionSearchResultsRequest request) 60 | { 61 | throw new NotImplementedException(); 62 | } 63 | 64 | [return: MessageParameter(Name = "RecordingInformation")] 65 | public virtual RecordingInformation GetRecordingInformation(string RecordingToken) 66 | { 67 | throw new NotImplementedException(); 68 | } 69 | 70 | [return: MessageParameter(Name = "ResultList")] 71 | public virtual GetRecordingSearchResultsResponse GetRecordingSearchResults(GetRecordingSearchResultsRequest request) 72 | { 73 | throw new NotImplementedException(); 74 | } 75 | 76 | [return: MessageParameter(Name = "Summary")] 77 | public virtual RecordingSummary GetRecordingSummary() 78 | { 79 | throw new NotImplementedException(); 80 | } 81 | 82 | [return: MessageParameter(Name = "State")] 83 | public virtual SearchState GetSearchState(string SearchToken) 84 | { 85 | throw new NotImplementedException(); 86 | } 87 | 88 | [return: MessageParameter(Name = "Capabilities")] 89 | public virtual Capabilities GetServiceCapabilities() 90 | { 91 | throw new NotImplementedException(); 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Search/SharpOnvifServer.Search.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Thermal/SharpOnvifServer.Thermal.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Thermal/ThermalPortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Thermal 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class ThermalPortBase : ThermalPort 9 | { 10 | [return: MessageParameter(Name = "Configuration")] 11 | public virtual Configuration GetConfiguration(string VideoSourceToken) 12 | { 13 | throw new NotImplementedException(); 14 | } 15 | 16 | [return: MessageParameter(Name = "ConfigurationOptions")] 17 | public virtual ConfigurationOptions GetConfigurationOptions(string VideoSourceToken) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | 22 | [return: MessageParameter(Name = "Configurations")] 23 | public virtual GetConfigurationsResponse GetConfigurations(GetConfigurationsRequest request) 24 | { 25 | throw new NotImplementedException(); 26 | } 27 | 28 | [return: MessageParameter(Name = "Configuration")] 29 | public virtual RadiometryConfiguration GetRadiometryConfiguration(string VideoSourceToken) 30 | { 31 | throw new NotImplementedException(); 32 | } 33 | 34 | [return: MessageParameter(Name = "ConfigurationOptions")] 35 | public virtual RadiometryConfigurationOptions GetRadiometryConfigurationOptions(string VideoSourceToken) 36 | { 37 | throw new NotImplementedException(); 38 | } 39 | 40 | [return: MessageParameter(Name = "Capabilities")] 41 | public virtual Capabilities GetServiceCapabilities() 42 | { 43 | throw new NotImplementedException(); 44 | } 45 | 46 | public virtual void SetConfiguration(string VideoSourceToken, Configuration Configuration) 47 | { 48 | throw new NotImplementedException(); 49 | } 50 | 51 | public virtual void SetRadiometryConfiguration(string VideoSourceToken, RadiometryConfiguration Configuration) 52 | { 53 | throw new NotImplementedException(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Uplink/SharpOnvifServer.Uplink.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/SharpOnvifServer.Uplink/UplinkPortBase.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using SharpOnvifServer.Security; 3 | using System; 4 | 5 | namespace SharpOnvifServer.Uplink 6 | { 7 | [DisableMustUnderstandValidation] 8 | public class UplinkPortBase : UplinkPort 9 | { 10 | public virtual DeleteUplinkResponse DeleteUplink(DeleteUplinkRequest request) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | [return: MessageParameter(Name = "Capabilities")] 16 | public virtual Capabilities GetServiceCapabilities() 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | 21 | [return: MessageParameter(Name = "Configuration")] 22 | public virtual GetUplinksResponse GetUplinks(GetUplinksRequest request) 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | 27 | public virtual void SetUplink(Configuration Configuration) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/SharpOnvifServer/IUserRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace SharpOnvifServer 4 | { 5 | public class UserInfo 6 | { 7 | public string UserName { get; set; } 8 | public string Password { get; set; } 9 | 10 | public UserInfo() 11 | { } 12 | 13 | public UserInfo(string userName, string password) 14 | { 15 | this.UserName = userName; 16 | this.Password = password; 17 | } 18 | } 19 | 20 | /// 21 | /// User repository. 22 | /// 23 | public interface IUserRepository 24 | { 25 | /// 26 | /// Get user from the user name. Returns null if the user does not exist. 27 | /// 28 | /// 29 | /// if the user exists, null otherwise. 30 | public Task GetUser(string userName); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/SharpOnvifServer/OnvifBindingFactory.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using CoreWCF.Channels; 3 | using System.Net; 4 | 5 | namespace SharpOnvifServer 6 | { 7 | /// 8 | /// Helper class for the CoreWCF bindings. 9 | /// 10 | public static class OnvifBindingFactory 11 | { 12 | /// 13 | /// Create an Onvif CoreWCF binding for the Digest authentication using Soap 1.2. 14 | /// 15 | /// using Digest authentication and Soap 1.2. 16 | public static CustomBinding CreateBinding() 17 | { 18 | var httpTransportBinding = new HttpTransportBindingElement 19 | { 20 | AuthenticationScheme = AuthenticationSchemes.Digest, 21 | }; 22 | var textMessageEncodingBinding = new TextMessageEncodingBindingElement 23 | { 24 | MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap12, AddressingVersion.None), 25 | }; 26 | var binding = new CustomBinding(textMessageEncodingBinding, httpTransportBinding); 27 | return binding; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/SharpOnvifServer/Security/DisableMustUnderstandAttribute.cs: -------------------------------------------------------------------------------- 1 | using CoreWCF; 2 | using CoreWCF.Channels; 3 | using CoreWCF.Description; 4 | using CoreWCF.Dispatcher; 5 | using System; 6 | using System.Collections.ObjectModel; 7 | 8 | namespace SharpOnvifServer.Security 9 | { 10 | /// 11 | /// Workaround: Required because the Security header is not understood by WCF and it would fail the request because there are unparsed headers at the end of the pipeline. 12 | /// 13 | [AttributeUsage(AttributeTargets.Class)] 14 | public class DisableMustUnderstandValidationAttribute : Attribute, IServiceBehavior 15 | { 16 | void IServiceBehavior.Validate(ServiceDescription description, ServiceHostBase serviceHostBase) { } 17 | void IServiceBehavior.AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection endpoints, BindingParameterCollection bindingParameters) { } 18 | void IServiceBehavior.ApplyDispatchBehavior(ServiceDescription description, ServiceHostBase serviceHostBase) 19 | { 20 | for (int i = 0; i < serviceHostBase.ChannelDispatchers.Count; i++) 21 | { 22 | if (serviceHostBase.ChannelDispatchers[i] is ChannelDispatcher channelDispatcher) 23 | { 24 | foreach (EndpointDispatcher endpointDispatcher in channelDispatcher.Endpoints) 25 | { 26 | if (endpointDispatcher.IsSystemEndpoint) continue; 27 | DispatchRuntime runtime = endpointDispatcher.DispatchRuntime; 28 | runtime.ValidateMustUnderstand = false; 29 | } 30 | } 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/SharpOnvifServer/SharpOnvifServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | disable 6 | disable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | --------------------------------------------------------------------------------