├── .github ├── CODEOWNERS └── workflows │ ├── build.yml │ └── publish-release.yml ├── renovate.json ├── src └── StandAloneNotification │ ├── INotificationClient.cs │ ├── Models │ ├── TextTokenType.cs │ ├── ReceiverEndPointType.cs │ └── Notification.cs │ ├── ServiceCollectionExtensions.cs │ ├── Exceptions │ └── NotificationException.cs │ ├── Directory.Build.targets │ ├── NotificationSettings.cs │ ├── StandAloneNotification.csproj │ ├── Directory.Build.props │ ├── Connected Services │ └── AltinnII.Services.Notification │ │ ├── ConnectedService.json │ │ └── Reference.cs │ └── NotificationClient.cs ├── test └── ClientTester │ ├── appsettings.json │ ├── UserSecrets.md │ ├── ClientTester.csproj │ └── Program.cs ├── README.md ├── LICENSE ├── AltinnIIClients.sln ├── .gitattributes └── .gitignore /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | /.github/CODEOWNERS @altinn/team-core 2 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "local>Altinn/renovate-config" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /src/StandAloneNotification/INotificationClient.cs: -------------------------------------------------------------------------------- 1 | using StandAloneNotification.Models; 2 | 3 | namespace StandAloneNotification; 4 | 5 | public interface INotificationClient 6 | { 7 | Task SendNotification(List notificationList); 8 | } -------------------------------------------------------------------------------- /test/ClientTester/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "NotificationSettings": { 3 | "ServiceEndpoint": "https://at22.altinn.cloud/ServiceEngineExternal/NotificationAgencyExternalBasic.svc", 4 | "Username": "dummy", 5 | "Password": "dummy" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/StandAloneNotification/Models/TextTokenType.cs: -------------------------------------------------------------------------------- 1 | namespace StandAloneNotification.Models 2 | { 3 | public class TextTokenType 4 | { 5 | /// 6 | /// Number of token to be substitued 7 | /// 8 | public int TokenNumber { get; set; } 9 | 10 | /// 11 | /// Value to replace with token 12 | /// 13 | public string TokenValue { get; set; } = string.Empty; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Altinn Legacy Clients 2 | 3 | The clients available in this project and the NuGet packages being published are temporary. The purpose here is to utilise capabilities in Altinn 2 untill those capabilities exists in Altinn 3. The clients are first of all being created for use in Altinn 3 apps. 4 | 5 | ## Notification 6 | 7 | This client is using the NotificationAgency service in Altinn 2 in order to produce notifications. 8 | 9 | https://altinn.github.io/docs/utviklingsguider/varsling/ 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/StandAloneNotification/ServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace StandAloneNotification; 5 | 6 | public static class ServiceCollectionExtensions 7 | { 8 | public static IServiceCollection AddNotificationServices(this IServiceCollection services, IConfiguration configuration) 9 | { 10 | services.Configure(configuration.GetSection("NotificationSettings")); 11 | services.AddSingleton(); 12 | 13 | return services; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/ClientTester/UserSecrets.md: -------------------------------------------------------------------------------- 1 | # User secrets 2 | 3 | This test program can read settings from user secrets. Using user secrets are recommended to avoid accidentally adding username and password to the git repository when performing tests locally. An application using the library is expected to complement the configuration object with values from a key vault. 4 | 5 | Change the dummy user name and password in the commands below and run them in the ClientTester project folder. 6 | 7 | ``` 8 | dotnet user-secrets set "NotificationSettings:Username" "dummy" 9 | dotnet user-secrets set "NotificationSettings:Password" "dummy" 10 | ``` 11 | -------------------------------------------------------------------------------- /src/StandAloneNotification/Exceptions/NotificationException.cs: -------------------------------------------------------------------------------- 1 | namespace StandAloneNotification.Exceptions 2 | { 3 | public class NotificationException : Exception 4 | { 5 | public string? AltinnErrorMessage; 6 | 7 | public string? AltinnExtendedErrorMessage; 8 | 9 | public string? AltinnLocalizedErrorMessage; 10 | 11 | public string? ErrorGuid; 12 | 13 | public int ErrorID; 14 | 15 | public string? UserGuid; 16 | 17 | public string? UserId; 18 | 19 | public NotificationException() { } 20 | public NotificationException(string message) : base(message) { } 21 | public NotificationException(string message, Exception inner) : base(message, inner) { } 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/StandAloneNotification/Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | all 5 | runtime; build; native; contentfiles; analyzers 6 | 7 | 8 | 9 | 10 | $([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)')) 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | permissions: 3 | contents: read 4 | on: 5 | push: 6 | branches: [ main ] 7 | pull_request: 8 | branches: [ main ] 9 | types: [opened, synchronize, reopened] 10 | workflow_dispatch: 11 | jobs: 12 | build: 13 | name: Build 14 | runs-on: windows-latest 15 | steps: 16 | - name: Setup .NET 17 | uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5.0.1 18 | with: 19 | dotnet-version: | 20 | 6.0.x 21 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 22 | with: 23 | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis 24 | - name: Build 25 | run: | 26 | cd src/StandAloneNotification 27 | dotnet build 28 | -------------------------------------------------------------------------------- /test/ClientTester/ClientTester.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | 79a3edd0-2092-40a2-a04d-dcb46q5ca9ed 7 | false 8 | enable 9 | enable 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | PreserveNewest 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/StandAloneNotification/NotificationSettings.cs: -------------------------------------------------------------------------------- 1 | namespace StandAloneNotification; 2 | 3 | /// 4 | /// This class is a strongly typed set of settings used by the notification client to 5 | /// communicate with the notification service in Altinn II. 6 | /// 7 | public class NotificationSettings 8 | { 9 | /// 10 | /// The endpoint address of the Altinn II service. 11 | /// 12 | public string ServiceEndpoint { get; set; } = string.Empty; 13 | 14 | /// 15 | /// The username of the agency system to be used in authentication against the Altinn II service. 16 | /// 17 | public string Username { get; set; } = string.Empty; 18 | 19 | /// 20 | /// The username of the agency system to be used in authentication against the Altinn II service. 21 | /// 22 | public string Password { get; set; } = string.Empty; 23 | } 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Altinn 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 | -------------------------------------------------------------------------------- /src/StandAloneNotification/Models/ReceiverEndPointType.cs: -------------------------------------------------------------------------------- 1 | namespace StandAloneNotification.Models 2 | { 3 | public class ReceiverEndPointType 4 | { 5 | /// 6 | /// Address to receiverEndpoint. Email or phonenumber (for sms) 7 | /// 8 | public string ReceiverAddress { get; set; } = string.Empty; 9 | 10 | /// 11 | /// Transporttype for notification, see #ReceiverTransportType 12 | /// 13 | public ReceiverTransportType ReceiverTransportType { get; set; } 14 | 15 | public ReceiverEndPointType(string receiverAdress, ReceiverTransportType receiverTransportType) 16 | { 17 | ReceiverAddress = receiverAdress; 18 | ReceiverTransportType = receiverTransportType; 19 | } 20 | } 21 | 22 | /// 23 | /// Different valid transporttypes for notification 24 | /// 25 | public enum ReceiverTransportType : int 26 | { 27 | SMS = 1, 28 | Email = 2, 29 | IM = 3, 30 | Both = 4, 31 | SMSPreferred = 5, 32 | EmailPreferred = 6, 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /.github/workflows/publish-release.yml: -------------------------------------------------------------------------------- 1 | name: Pack and publish nugets 2 | permissions: 3 | contents: write 4 | 5 | on: 6 | release: 7 | types: 8 | - published 9 | 10 | jobs: 11 | build-pack: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 15 | with: 16 | fetch-depth: 0 17 | 18 | - name: Install dotnet6 19 | uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5.0.1 20 | with: 21 | dotnet-version: | 22 | 6.0.x 23 | - name: Install deps 24 | run: | 25 | dotnet restore 26 | - name: Build 27 | run: | 28 | dotnet build --configuration Release --no-restore -p:Deterministic=true -p:BuildNumber=${{ github.run_number }} 29 | - name: Pack and publish StandAloneNotification 30 | if: startsWith(github.ref, 'refs/tags/Notification-') 31 | run: | 32 | dotnet pack src/StandAloneNotification/StandAloneNotification.csproj --configuration Release --no-restore --no-build -p:BuildNumber=${{ github.run_number }} -p:Deterministic=true 33 | dotnet nuget push src/StandAloneNotification/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} -------------------------------------------------------------------------------- /src/StandAloneNotification/StandAloneNotification.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | Library 6 | enable 7 | enable 8 | 9 | 10 | Altinn.Legacy.Client.Notification 11 | Altinn;NotificationClient 12 | 13 | Package to send notification (email/sms) through Altinn II 14 | 15 | 16 | 17 | Altinn Platform Contributors 18 | git 19 | https://github.com/Altinn/altinn-legacy-clients 20 | true 21 | Notification- 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/StandAloneNotification/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | $([System.IO.Directory]::GetParent($(MSBuildThisFileDirectory)).Parent.FullName) 10 | preview 11 | true 12 | 10.0 13 | 14 | 15 | 16 | 17 | $(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BuildNumber) 18 | $(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BuildNumber) 19 | $(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BuildNumber) 20 | 21 | 22 | 23 | 24 | true 25 | true 26 | true 27 | snupkg 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | true 36 | 37 | -------------------------------------------------------------------------------- /test/ClientTester/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Microsoft.Extensions.Options; 6 | using StandAloneNotification; 7 | using StandAloneNotification.Exceptions; 8 | using StandAloneNotification.Models; 9 | 10 | internal class Program 11 | { 12 | private static async Task Main(string[] args) 13 | { 14 | var configuration = new ConfigurationBuilder() 15 | .AddJsonFile("appsettings.json", false) 16 | .AddUserSecrets(Assembly.GetExecutingAssembly()) 17 | .Build(); 18 | 19 | NotificationSettings notificationSettings = new(); 20 | configuration.GetRequiredSection("NotificationSettings").Bind(notificationSettings); 21 | 22 | var serviceProvider = new ServiceCollection() 23 | .AddNotificationServices(configuration) 24 | .AddSingleton(Options.Create(notificationSettings)) 25 | .BuildServiceProvider(); 26 | 27 | Notification notification = new() 28 | { 29 | IsReservable = true, 30 | LanguageId = "no", 31 | ReporteeNumber = "910074431", //ReporteeNumber = "910460293", 32 | ReceiverEndPoints = new List { new ReceiverEndPointType("", ReceiverTransportType.Email) }, 33 | NotificationType = "MacroTest" 34 | }; 35 | 36 | var notificationClient = serviceProvider.GetRequiredService(); 37 | 38 | try 39 | { 40 | await notificationClient.SendNotification(new List { notification }); 41 | } 42 | catch (NotificationException e) 43 | { 44 | Console.WriteLine(e.AltinnErrorMessage); 45 | } 46 | 47 | Console.WriteLine("Hello, World!"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /AltinnIIClients.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32901.215 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02F9C0AD-6C7D-4DE8-870C-5F72955D96CD}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StandAloneNotification", "src\StandAloneNotification\StandAloneNotification.csproj", "{CBBB930E-47BD-465F-B8E6-0C5CEE89EDD2}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{DCE69242-FAB3-409D-ACE8-7C86E813ABC9}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClientTester", "test\ClientTester\ClientTester.csproj", "{100E69BD-040E-455D-8AC9-CFC41D80CAAF}" 13 | EndProject 14 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{91D25668-0500-4439-84E9-C8763C4CCE1B}" 15 | ProjectSection(SolutionItems) = preProject 16 | README.md = README.md 17 | EndProjectSection 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|Any CPU = Debug|Any CPU 22 | Release|Any CPU = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {CBBB930E-47BD-465F-B8E6-0C5CEE89EDD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {CBBB930E-47BD-465F-B8E6-0C5CEE89EDD2}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {CBBB930E-47BD-465F-B8E6-0C5CEE89EDD2}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {CBBB930E-47BD-465F-B8E6-0C5CEE89EDD2}.Release|Any CPU.Build.0 = Release|Any CPU 29 | {100E69BD-040E-455D-8AC9-CFC41D80CAAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {100E69BD-040E-455D-8AC9-CFC41D80CAAF}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {100E69BD-040E-455D-8AC9-CFC41D80CAAF}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {100E69BD-040E-455D-8AC9-CFC41D80CAAF}.Release|Any CPU.Build.0 = Release|Any CPU 33 | EndGlobalSection 34 | GlobalSection(SolutionProperties) = preSolution 35 | HideSolutionNode = FALSE 36 | EndGlobalSection 37 | GlobalSection(NestedProjects) = preSolution 38 | {CBBB930E-47BD-465F-B8E6-0C5CEE89EDD2} = {02F9C0AD-6C7D-4DE8-870C-5F72955D96CD} 39 | {100E69BD-040E-455D-8AC9-CFC41D80CAAF} = {DCE69242-FAB3-409D-ACE8-7C86E813ABC9} 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | SolutionGuid = {B3CE336F-16FD-428E-A3CF-9FB9D58B8C98} 43 | EndGlobalSection 44 | EndGlobal 45 | -------------------------------------------------------------------------------- /src/StandAloneNotification/Connected Services/AltinnII.Services.Notification/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExtendedData": { 3 | "inputs": [ 4 | "https://www.altinn.no/ServiceEngineExternal/NotificationAgencyExternalBasic.svc" 5 | ], 6 | "collectionTypes": [ 7 | "System.Array", 8 | "System.Collections.Generic.Dictionary`2" 9 | ], 10 | "internalTypeAccess": true, 11 | "namespaceMappings": [ 12 | "*, AltinnII.Services.Notification" 13 | ], 14 | "references": [ 15 | "Microsoft.IdentityModel.Logging, {Microsoft.IdentityModel.Logging, 6.8.0}", 16 | "Microsoft.IdentityModel.Protocols.WsTrust, {Microsoft.IdentityModel.Protocols.WsTrust, 6.8.0}", 17 | "Microsoft.IdentityModel.Tokens, {Microsoft.IdentityModel.Tokens, 6.8.0}", 18 | "Microsoft.IdentityModel.Tokens.Saml, {Microsoft.IdentityModel.Tokens.Saml, 6.8.0}", 19 | "Microsoft.IdentityModel.Xml, {Microsoft.IdentityModel.Xml, 6.8.0}", 20 | "System.IO, {System.IO, 4.3.0}", 21 | "System.Reflection.DispatchProxy, {System.Reflection.DispatchProxy, 4.7.1}", 22 | "System.Runtime, {System.Runtime, 4.3.0}", 23 | "System.Security.AccessControl, {System.Security.AccessControl, 4.7.0}", 24 | "System.Security.Cryptography.Cng, {System.Security.Cryptography.Cng, 4.7.0}", 25 | "System.Security.Cryptography.Xml, {System.Security.Cryptography.Xml, 4.7.0}", 26 | "System.Security.Permissions, {System.Security.Permissions, 4.7.0}", 27 | "System.Security.Principal.Windows, {System.Security.Principal.Windows, 4.7.0}", 28 | "System.ServiceModel, {System.ServiceModel.Primitives, 4.8.1}", 29 | "System.ServiceModel.Duplex, {System.ServiceModel.Duplex, 4.8.1}", 30 | "System.ServiceModel.Federation, {System.ServiceModel.Federation, 4.8.1}", 31 | "System.ServiceModel.Http, {System.ServiceModel.Http, 4.8.1}", 32 | "System.ServiceModel.NetTcp, {System.ServiceModel.NetTcp, 4.8.1}", 33 | "System.ServiceModel.Primitives, {System.ServiceModel.Primitives, 4.8.1}", 34 | "System.ServiceModel.Security, {System.ServiceModel.Security, 4.8.1}", 35 | "System.Text.Encoding, {System.Text.Encoding, 4.3.0}", 36 | "System.Threading.Tasks, {System.Threading.Tasks, 4.3.0}", 37 | "System.Windows.Extensions, {System.Windows.Extensions, 4.7.0}", 38 | "System.Xml.ReaderWriter, {System.Xml.ReaderWriter, 4.3.0}", 39 | "System.Xml.XmlDocument, {System.Xml.XmlDocument, 4.3.0}" 40 | ], 41 | "targetFramework": "net6.0", 42 | "typeReuseMode": "All" 43 | } 44 | } -------------------------------------------------------------------------------- /src/StandAloneNotification/Models/Notification.cs: -------------------------------------------------------------------------------- 1 | namespace StandAloneNotification.Models; 2 | 3 | /// 4 | /// Defines the necessary details needed to create a notification and to send that through the 5 | /// Altinn II Notification service. 6 | /// 7 | public class Notification 8 | { 9 | /// 10 | /// This value tells the notification service which notification type to use. Notification type 11 | /// is a concept around text templates. This service assumes prior knowledge about what notification 12 | /// types that are available in Altinn II. 13 | /// 14 | public string NotificationType { get; set; } = string.Empty; 15 | 16 | /// 17 | /// This value indicate whether the reportee (person) reservation flag is to be respected. 18 | /// 19 | public bool IsReservable { get; set; } 20 | 21 | /// 22 | /// This value tells the notification service which language to use when selecting texts from the 23 | /// given notification type. Default language is no - Norwegian bokmål. 24 | /// 25 | public string LanguageId { get; set; } = "no"; 26 | 27 | /// 28 | /// The person or organisation that the notification is targeting for identification of recipients and 29 | /// authorization. 30 | /// 31 | public string ReporteeNumber { get; set; } = string.Empty; 32 | 33 | /// 34 | /// Endpoints for notification. When Reportee is an Organization and ReceiverEndpoint has no ReceiverAddress, 35 | /// receiverAddresses will be generated from the Organization Profile, 36 | /// and additional ReceiverEndPoints will be generated based on the UnitReportee profile and supplied ServiceCode. 37 | /// 38 | public List ReceiverEndPoints { get; set; } = new(); 39 | 40 | /// 41 | /// ServiceCode for the service the notification will be authorized against 42 | /// 43 | public string ServiceCode { get; set; } = string.Empty; 44 | 45 | /// 46 | /// ServiceEdition for the service the notification will be authorized against 47 | /// 48 | public int ServiceEdition { get; set; } 49 | 50 | /// 51 | /// List of roles needed to get this notification 52 | /// 53 | public List Roles { get; set; } = new(); 54 | 55 | /// 56 | /// List of textTokens to substitute in the notification 57 | /// 58 | public List TextTokens { get; set; } = new(); 59 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /src/StandAloneNotification/NotificationClient.cs: -------------------------------------------------------------------------------- 1 | using System.ServiceModel; 2 | using System.ServiceModel.Channels; 3 | 4 | using AltinnII.Services.Notification; 5 | using Microsoft.Extensions.Options; 6 | using StandAloneNotification.Exceptions; 7 | using StandAloneNotification.Models; 8 | 9 | namespace StandAloneNotification; 10 | 11 | public class NotificationClient : INotificationClient 12 | { 13 | private readonly NotificationSettings _notificationSettings; 14 | 15 | public NotificationClient(IOptions notificationSettings) 16 | { 17 | _notificationSettings = notificationSettings.Value; 18 | } 19 | 20 | public async Task SendNotification(List notificationList) 21 | { 22 | Binding binding = GetBindingForEndpoint(new TimeSpan(0, 0, 30)); 23 | EndpointAddress endpointAddress = GetEndpointAddress(_notificationSettings.ServiceEndpoint); 24 | NotificationAgencyExternalBasicClient client = new(binding, endpointAddress); 25 | 26 | try 27 | { 28 | SendStandaloneNotificationBasicV3Response response = await client.SendStandaloneNotificationBasicV3Async( 29 | _notificationSettings.Username, 30 | _notificationSettings.Password, 31 | GetStandaloneNotifications(notificationList)); 32 | } 33 | catch (FaultException e) 34 | { 35 | throw GetNotificationException(e); 36 | } 37 | } 38 | 39 | private static StandaloneNotificationBEList GetStandaloneNotifications(List notificationList) 40 | { 41 | StandaloneNotificationBEList standaloneNotifications = new(); 42 | foreach (Notification notification in notificationList) 43 | { 44 | standaloneNotifications.Add(new StandaloneNotification 45 | { 46 | IsReservable = notification.IsReservable, 47 | LanguageID = ConvertLanguage(notification.LanguageId), 48 | ReporteeNumber = notification.ReporteeNumber, 49 | NotificationType = notification.NotificationType, 50 | Service = GetService(notification), 51 | Roles = GetRoles(notification), 52 | ReceiverEndPoints = GetReceiverEndpoints(notification), 53 | TextTokens = GetTextTokens(notification) 54 | }); 55 | } 56 | return standaloneNotifications; 57 | } 58 | 59 | private static int ConvertLanguage(string language) 60 | { 61 | switch (language) 62 | { 63 | case "en": 64 | return 1033; 65 | case "no": 66 | return 1044; 67 | case "nn": 68 | return 2068; 69 | default: 70 | return 1044; 71 | } 72 | } 73 | 74 | private static Service? GetService(Notification notification) 75 | { 76 | if (!string.IsNullOrEmpty(notification.ServiceCode) && notification.ServiceEdition > 0) 77 | { 78 | return new() 79 | { 80 | ServiceCode = notification.ServiceCode, 81 | ServiceEdition = notification.ServiceEdition 82 | }; 83 | } 84 | return null; 85 | } 86 | 87 | private static Roles? GetRoles(Notification notification) 88 | { 89 | if (notification.Roles != null && notification.Roles.Count > 0) 90 | { 91 | Roles roles = new(); 92 | foreach(string element in notification.Roles) 93 | { 94 | roles.Add(element); 95 | } 96 | return roles; 97 | } 98 | return null; 99 | } 100 | 101 | private static ReceiverEndPointBEList? GetReceiverEndpoints(Notification notification) 102 | { 103 | if(notification.ReceiverEndPoints != null && notification.ReceiverEndPoints.Count > 0) 104 | { 105 | ReceiverEndPointBEList receiverEndpoints = new ReceiverEndPointBEList(); 106 | foreach(ReceiverEndPointType element in notification.ReceiverEndPoints) 107 | { 108 | receiverEndpoints.Add(new ReceiverEndPoint() 109 | { 110 | TransportType = (TransportType) element.ReceiverTransportType, 111 | ReceiverAddress = element.ReceiverAddress 112 | }); 113 | } 114 | return receiverEndpoints; 115 | } 116 | return null; 117 | } 118 | 119 | private static TextTokenSubstitutionBEList? GetTextTokens(Notification notification) 120 | { 121 | if (notification.TextTokens != null && notification.TextTokens.Count > 0) 122 | { 123 | TextTokenSubstitutionBEList textTokens = new TextTokenSubstitutionBEList(); 124 | foreach (TextTokenType element in notification.TextTokens) 125 | { 126 | textTokens.Add(new TextToken 127 | { 128 | TokenNum = element.TokenNumber, 129 | TokenValue = element.TokenValue 130 | }); 131 | } 132 | return textTokens; 133 | } 134 | return null; 135 | } 136 | 137 | private static Binding GetBindingForEndpoint(TimeSpan timeout) 138 | { 139 | var httpsBinding = new BasicHttpBinding(); 140 | httpsBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None; 141 | httpsBinding.Security.Mode = BasicHttpSecurityMode.Transport; 142 | 143 | var integerMaxValue = int.MaxValue; 144 | httpsBinding.MaxReceivedMessageSize = integerMaxValue; 145 | httpsBinding.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; 146 | httpsBinding.AllowCookies = true; 147 | 148 | httpsBinding.ReceiveTimeout = timeout; 149 | httpsBinding.SendTimeout = timeout; 150 | httpsBinding.OpenTimeout = timeout; 151 | httpsBinding.CloseTimeout = timeout; 152 | 153 | return httpsBinding; 154 | } 155 | 156 | private static EndpointAddress GetEndpointAddress(string endpointUrl) 157 | { 158 | if (!endpointUrl.StartsWith("https://")) 159 | { 160 | throw new UriFormatException("The endpoint URL must start with https://."); 161 | } 162 | 163 | return new EndpointAddress(endpointUrl); 164 | } 165 | 166 | private static NotificationException GetNotificationException(FaultException e) 167 | { 168 | return new NotificationException(e.Detail.AltinnErrorMessage) 169 | { 170 | AltinnErrorMessage = e.Detail.AltinnErrorMessage, 171 | AltinnExtendedErrorMessage = e.Detail.AltinnExtendedErrorMessage, 172 | AltinnLocalizedErrorMessage = e.Detail.AltinnLocalizedErrorMessage, 173 | ErrorGuid = e.Detail.ErrorGuid, 174 | ErrorID = e.Detail.ErrorID, 175 | UserGuid = e.Detail.UserGuid, 176 | UserId = e.Detail.UserId 177 | }; 178 | } 179 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd 364 | -------------------------------------------------------------------------------- /src/StandAloneNotification/Connected Services/AltinnII.Services.Notification/Reference.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | namespace AltinnII.Services.Notification 11 | { 12 | using System.Runtime.Serialization; 13 | 14 | 15 | [System.Diagnostics.DebuggerStepThroughAttribute()] 16 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 17 | [System.Runtime.Serialization.DataContractAttribute(Name="AltinnFault", Namespace="http://www.altinn.no/services/common/fault/2009/10")] 18 | internal partial class AltinnFault : object 19 | { 20 | 21 | private string AltinnErrorMessageField; 22 | 23 | private string AltinnExtendedErrorMessageField; 24 | 25 | private string AltinnLocalizedErrorMessageField; 26 | 27 | private string ErrorGuidField; 28 | 29 | private int ErrorIDField; 30 | 31 | private string UserGuidField; 32 | 33 | private string UserIdField; 34 | 35 | [System.Runtime.Serialization.DataMemberAttribute()] 36 | internal string AltinnErrorMessage 37 | { 38 | get 39 | { 40 | return this.AltinnErrorMessageField; 41 | } 42 | set 43 | { 44 | this.AltinnErrorMessageField = value; 45 | } 46 | } 47 | 48 | [System.Runtime.Serialization.DataMemberAttribute()] 49 | internal string AltinnExtendedErrorMessage 50 | { 51 | get 52 | { 53 | return this.AltinnExtendedErrorMessageField; 54 | } 55 | set 56 | { 57 | this.AltinnExtendedErrorMessageField = value; 58 | } 59 | } 60 | 61 | [System.Runtime.Serialization.DataMemberAttribute()] 62 | internal string AltinnLocalizedErrorMessage 63 | { 64 | get 65 | { 66 | return this.AltinnLocalizedErrorMessageField; 67 | } 68 | set 69 | { 70 | this.AltinnLocalizedErrorMessageField = value; 71 | } 72 | } 73 | 74 | [System.Runtime.Serialization.DataMemberAttribute()] 75 | internal string ErrorGuid 76 | { 77 | get 78 | { 79 | return this.ErrorGuidField; 80 | } 81 | set 82 | { 83 | this.ErrorGuidField = value; 84 | } 85 | } 86 | 87 | [System.Runtime.Serialization.DataMemberAttribute()] 88 | internal int ErrorID 89 | { 90 | get 91 | { 92 | return this.ErrorIDField; 93 | } 94 | set 95 | { 96 | this.ErrorIDField = value; 97 | } 98 | } 99 | 100 | [System.Runtime.Serialization.DataMemberAttribute()] 101 | internal string UserGuid 102 | { 103 | get 104 | { 105 | return this.UserGuidField; 106 | } 107 | set 108 | { 109 | this.UserGuidField = value; 110 | } 111 | } 112 | 113 | [System.Runtime.Serialization.DataMemberAttribute()] 114 | internal string UserId 115 | { 116 | get 117 | { 118 | return this.UserIdField; 119 | } 120 | set 121 | { 122 | this.UserIdField = value; 123 | } 124 | } 125 | } 126 | 127 | [System.Diagnostics.DebuggerStepThroughAttribute()] 128 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 129 | [System.Runtime.Serialization.CollectionDataContractAttribute(Name="StandaloneNotificationBEList", Namespace="http://schemas.altinn.no/services/ServiceEngine/StandaloneNotificationBE/2009/10", ItemName="StandaloneNotification")] 130 | internal class StandaloneNotificationBEList : System.Collections.Generic.List 131 | { 132 | } 133 | 134 | [System.Diagnostics.DebuggerStepThroughAttribute()] 135 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 136 | [System.Runtime.Serialization.DataContractAttribute(Name="StandaloneNotification", Namespace="http://schemas.altinn.no/services/ServiceEngine/Notification/2009/10")] 137 | internal partial class StandaloneNotification : object 138 | { 139 | 140 | private string FromAddressField; 141 | 142 | private System.Nullable IsReservableField; 143 | 144 | private int LanguageIDField; 145 | 146 | private string NotificationTypeField; 147 | 148 | private AltinnII.Services.Notification.ReceiverEndPointBEList ReceiverEndPointsField; 149 | 150 | private string ReporteeNumberField; 151 | 152 | private AltinnII.Services.Notification.Roles RolesField; 153 | 154 | private AltinnII.Services.Notification.Service ServiceField; 155 | 156 | private System.DateTime ShipmentDateTimeField; 157 | 158 | private AltinnII.Services.Notification.TextTokenSubstitutionBEList TextTokensField; 159 | 160 | private System.Nullable UseServiceOwnerShortNameAsSenderOfSmsField; 161 | 162 | [System.Runtime.Serialization.DataMemberAttribute()] 163 | internal string FromAddress 164 | { 165 | get 166 | { 167 | return this.FromAddressField; 168 | } 169 | set 170 | { 171 | this.FromAddressField = value; 172 | } 173 | } 174 | 175 | [System.Runtime.Serialization.DataMemberAttribute()] 176 | internal System.Nullable IsReservable 177 | { 178 | get 179 | { 180 | return this.IsReservableField; 181 | } 182 | set 183 | { 184 | this.IsReservableField = value; 185 | } 186 | } 187 | 188 | [System.Runtime.Serialization.DataMemberAttribute()] 189 | internal int LanguageID 190 | { 191 | get 192 | { 193 | return this.LanguageIDField; 194 | } 195 | set 196 | { 197 | this.LanguageIDField = value; 198 | } 199 | } 200 | 201 | [System.Runtime.Serialization.DataMemberAttribute()] 202 | internal string NotificationType 203 | { 204 | get 205 | { 206 | return this.NotificationTypeField; 207 | } 208 | set 209 | { 210 | this.NotificationTypeField = value; 211 | } 212 | } 213 | 214 | [System.Runtime.Serialization.DataMemberAttribute()] 215 | internal AltinnII.Services.Notification.ReceiverEndPointBEList ReceiverEndPoints 216 | { 217 | get 218 | { 219 | return this.ReceiverEndPointsField; 220 | } 221 | set 222 | { 223 | this.ReceiverEndPointsField = value; 224 | } 225 | } 226 | 227 | [System.Runtime.Serialization.DataMemberAttribute()] 228 | internal string ReporteeNumber 229 | { 230 | get 231 | { 232 | return this.ReporteeNumberField; 233 | } 234 | set 235 | { 236 | this.ReporteeNumberField = value; 237 | } 238 | } 239 | 240 | [System.Runtime.Serialization.DataMemberAttribute()] 241 | internal AltinnII.Services.Notification.Roles Roles 242 | { 243 | get 244 | { 245 | return this.RolesField; 246 | } 247 | set 248 | { 249 | this.RolesField = value; 250 | } 251 | } 252 | 253 | [System.Runtime.Serialization.DataMemberAttribute()] 254 | internal AltinnII.Services.Notification.Service Service 255 | { 256 | get 257 | { 258 | return this.ServiceField; 259 | } 260 | set 261 | { 262 | this.ServiceField = value; 263 | } 264 | } 265 | 266 | [System.Runtime.Serialization.DataMemberAttribute()] 267 | internal System.DateTime ShipmentDateTime 268 | { 269 | get 270 | { 271 | return this.ShipmentDateTimeField; 272 | } 273 | set 274 | { 275 | this.ShipmentDateTimeField = value; 276 | } 277 | } 278 | 279 | [System.Runtime.Serialization.DataMemberAttribute()] 280 | internal AltinnII.Services.Notification.TextTokenSubstitutionBEList TextTokens 281 | { 282 | get 283 | { 284 | return this.TextTokensField; 285 | } 286 | set 287 | { 288 | this.TextTokensField = value; 289 | } 290 | } 291 | 292 | [System.Runtime.Serialization.DataMemberAttribute()] 293 | internal System.Nullable UseServiceOwnerShortNameAsSenderOfSms 294 | { 295 | get 296 | { 297 | return this.UseServiceOwnerShortNameAsSenderOfSmsField; 298 | } 299 | set 300 | { 301 | this.UseServiceOwnerShortNameAsSenderOfSmsField = value; 302 | } 303 | } 304 | } 305 | 306 | [System.Diagnostics.DebuggerStepThroughAttribute()] 307 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 308 | [System.Runtime.Serialization.DataContractAttribute(Name="Service", Namespace="http://schemas.altinn.no/services/ServiceEngine/StandaloneNotificationBE/2015/06")] 309 | internal partial class Service : object 310 | { 311 | 312 | private string ServiceCodeField; 313 | 314 | private int ServiceEditionField; 315 | 316 | [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)] 317 | internal string ServiceCode 318 | { 319 | get 320 | { 321 | return this.ServiceCodeField; 322 | } 323 | set 324 | { 325 | this.ServiceCodeField = value; 326 | } 327 | } 328 | 329 | [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)] 330 | internal int ServiceEdition 331 | { 332 | get 333 | { 334 | return this.ServiceEditionField; 335 | } 336 | set 337 | { 338 | this.ServiceEditionField = value; 339 | } 340 | } 341 | } 342 | 343 | [System.Diagnostics.DebuggerStepThroughAttribute()] 344 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 345 | [System.Runtime.Serialization.CollectionDataContractAttribute(Name="ReceiverEndPointBEList", Namespace="http://schemas.altinn.no/services/ServiceEngine/Notification/2009/10", ItemName="ReceiverEndPoint")] 346 | internal class ReceiverEndPointBEList : System.Collections.Generic.List 347 | { 348 | } 349 | 350 | [System.Diagnostics.DebuggerStepThroughAttribute()] 351 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 352 | [System.Runtime.Serialization.CollectionDataContractAttribute(Name="Roles", Namespace="http://schemas.altinn.no/services/ServiceEngine/StandaloneNotificationBE/2015/06", ItemName="RoleName")] 353 | internal class Roles : System.Collections.Generic.List 354 | { 355 | } 356 | 357 | [System.Diagnostics.DebuggerStepThroughAttribute()] 358 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 359 | [System.Runtime.Serialization.CollectionDataContractAttribute(Name="TextTokenSubstitutionBEList", Namespace="http://schemas.altinn.no/services/ServiceEngine/Notification/2009/10", ItemName="TextToken")] 360 | internal class TextTokenSubstitutionBEList : System.Collections.Generic.List 361 | { 362 | } 363 | 364 | [System.Diagnostics.DebuggerStepThroughAttribute()] 365 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 366 | [System.Runtime.Serialization.DataContractAttribute(Name="ReceiverEndPoint", Namespace="http://schemas.altinn.no/services/ServiceEngine/Notification/2009/10")] 367 | internal partial class ReceiverEndPoint : object 368 | { 369 | 370 | private System.Nullable TransportTypeField; 371 | 372 | private string ReceiverAddressField; 373 | 374 | [System.Runtime.Serialization.DataMemberAttribute()] 375 | internal System.Nullable TransportType 376 | { 377 | get 378 | { 379 | return this.TransportTypeField; 380 | } 381 | set 382 | { 383 | this.TransportTypeField = value; 384 | } 385 | } 386 | 387 | [System.Runtime.Serialization.DataMemberAttribute(Order=1)] 388 | internal string ReceiverAddress 389 | { 390 | get 391 | { 392 | return this.ReceiverAddressField; 393 | } 394 | set 395 | { 396 | this.ReceiverAddressField = value; 397 | } 398 | } 399 | } 400 | 401 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 402 | [System.Runtime.Serialization.DataContractAttribute(Name="TransportType", Namespace="http://schemas.altinn.no/serviceengine/formsengine/2009/10")] 403 | internal enum TransportType : int 404 | { 405 | 406 | [System.Runtime.Serialization.EnumMemberAttribute()] 407 | SMS = 1, 408 | 409 | [System.Runtime.Serialization.EnumMemberAttribute()] 410 | Email = 2, 411 | 412 | [System.Runtime.Serialization.EnumMemberAttribute()] 413 | IM = 3, 414 | 415 | [System.Runtime.Serialization.EnumMemberAttribute()] 416 | Both = 4, 417 | 418 | [System.Runtime.Serialization.EnumMemberAttribute()] 419 | SMSPreferred = 5, 420 | 421 | [System.Runtime.Serialization.EnumMemberAttribute()] 422 | EmailPreferred = 6, 423 | } 424 | 425 | [System.Diagnostics.DebuggerStepThroughAttribute()] 426 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 427 | [System.Runtime.Serialization.DataContractAttribute(Name="TextToken", Namespace="http://schemas.altinn.no/services/ServiceEngine/Notification/2009/10")] 428 | internal partial class TextToken : object 429 | { 430 | 431 | private int TokenNumField; 432 | 433 | private string TokenValueField; 434 | 435 | [System.Runtime.Serialization.DataMemberAttribute()] 436 | internal int TokenNum 437 | { 438 | get 439 | { 440 | return this.TokenNumField; 441 | } 442 | set 443 | { 444 | this.TokenNumField = value; 445 | } 446 | } 447 | 448 | [System.Runtime.Serialization.DataMemberAttribute()] 449 | internal string TokenValue 450 | { 451 | get 452 | { 453 | return this.TokenValueField; 454 | } 455 | set 456 | { 457 | this.TokenValueField = value; 458 | } 459 | } 460 | } 461 | 462 | [System.Diagnostics.DebuggerStepThroughAttribute()] 463 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 464 | [System.Runtime.Serialization.CollectionDataContractAttribute(Name="SendNotificationResultList", Namespace="http://schemas.altinn.no/services/ServiceEngine/Notification/2015/06", ItemName="NotificationResult")] 465 | internal class SendNotificationResultList : System.Collections.Generic.List 466 | { 467 | } 468 | 469 | [System.Diagnostics.DebuggerStepThroughAttribute()] 470 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 471 | [System.Runtime.Serialization.DataContractAttribute(Name="NotificationResult", Namespace="http://schemas.altinn.no/services/ServiceEngine/Notification/2015/06")] 472 | internal partial class NotificationResult : object 473 | { 474 | 475 | private AltinnII.Services.Notification.EndPointResultList EndPointsField; 476 | 477 | private string NotificationTypeField; 478 | 479 | private string ReporteeNumberField; 480 | 481 | [System.Runtime.Serialization.DataMemberAttribute()] 482 | internal AltinnII.Services.Notification.EndPointResultList EndPoints 483 | { 484 | get 485 | { 486 | return this.EndPointsField; 487 | } 488 | set 489 | { 490 | this.EndPointsField = value; 491 | } 492 | } 493 | 494 | [System.Runtime.Serialization.DataMemberAttribute()] 495 | internal string NotificationType 496 | { 497 | get 498 | { 499 | return this.NotificationTypeField; 500 | } 501 | set 502 | { 503 | this.NotificationTypeField = value; 504 | } 505 | } 506 | 507 | [System.Runtime.Serialization.DataMemberAttribute()] 508 | internal string ReporteeNumber 509 | { 510 | get 511 | { 512 | return this.ReporteeNumberField; 513 | } 514 | set 515 | { 516 | this.ReporteeNumberField = value; 517 | } 518 | } 519 | } 520 | 521 | [System.Diagnostics.DebuggerStepThroughAttribute()] 522 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 523 | [System.Runtime.Serialization.CollectionDataContractAttribute(Name="EndPointResultList", Namespace="http://schemas.altinn.no/services/ServiceEngine/Notification/2015/06", ItemName="EndPointResult")] 524 | internal class EndPointResultList : System.Collections.Generic.List 525 | { 526 | } 527 | 528 | [System.Diagnostics.DebuggerStepThroughAttribute()] 529 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 530 | [System.Runtime.Serialization.DataContractAttribute(Name="EndPointResult", Namespace="http://schemas.altinn.no/services/ServiceEngine/Notification/2015/06")] 531 | internal partial class EndPointResult : object 532 | { 533 | 534 | private string NameField; 535 | 536 | private string ReceiverAddressField; 537 | 538 | private System.Nullable RetrieveFromProfileField; 539 | 540 | private AltinnII.Services.Notification.TransportType TransportTypeField; 541 | 542 | [System.Runtime.Serialization.DataMemberAttribute()] 543 | internal string Name 544 | { 545 | get 546 | { 547 | return this.NameField; 548 | } 549 | set 550 | { 551 | this.NameField = value; 552 | } 553 | } 554 | 555 | [System.Runtime.Serialization.DataMemberAttribute()] 556 | internal string ReceiverAddress 557 | { 558 | get 559 | { 560 | return this.ReceiverAddressField; 561 | } 562 | set 563 | { 564 | this.ReceiverAddressField = value; 565 | } 566 | } 567 | 568 | [System.Runtime.Serialization.DataMemberAttribute()] 569 | internal System.Nullable RetrieveFromProfile 570 | { 571 | get 572 | { 573 | return this.RetrieveFromProfileField; 574 | } 575 | set 576 | { 577 | this.RetrieveFromProfileField = value; 578 | } 579 | } 580 | 581 | [System.Runtime.Serialization.DataMemberAttribute()] 582 | internal AltinnII.Services.Notification.TransportType TransportType 583 | { 584 | get 585 | { 586 | return this.TransportTypeField; 587 | } 588 | set 589 | { 590 | this.TransportTypeField = value; 591 | } 592 | } 593 | } 594 | 595 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 596 | [System.ServiceModel.ServiceContractAttribute(Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10", ConfigurationName="AltinnII.Services.Notification.INotificationAgencyExternalBasic")] 597 | internal interface INotificationAgencyExternalBasic 598 | { 599 | 600 | [System.ServiceModel.OperationContractAttribute(Action="http://www.altinn.no/services/2009/10/IAltinnContractBase/Test", ReplyAction="http://www.altinn.no/services/2009/10/IAltinnContractBase/TestResponse")] 601 | [System.ServiceModel.FaultContractAttribute(typeof(AltinnII.Services.Notification.AltinnFault), Action="http://www.altinn.no/services/2009/10/IAltinnContractBase/TestAltinnFaultFault", Name="AltinnFault", Namespace="http://www.altinn.no/services/common/fault/2009/10")] 602 | System.Threading.Tasks.Task TestAsync(AltinnII.Services.Notification.TestRequest request); 603 | 604 | [System.ServiceModel.OperationContractAttribute(Action="http://www.altinn.no/services/ServiceEngine/Notification/2010/10/INotificationAge" + 605 | "ncyExternalBasic/SendStandaloneNotificationBasic", ReplyAction="http://www.altinn.no/services/ServiceEngine/Notification/2010/10/INotificationAge" + 606 | "ncyExternalBasic/SendStandaloneNotificationBasicResponse")] 607 | [System.ServiceModel.FaultContractAttribute(typeof(AltinnII.Services.Notification.AltinnFault), Action="http://www.altinn.no/services/ServiceEngine/Notification/2010/10/INotificationAge" + 608 | "ncyExternalBasic/SendStandaloneNotificationBasicAltinnFaultFault", Name="AltinnFault", Namespace="http://www.altinn.no/services/common/fault/2009/10")] 609 | System.Threading.Tasks.Task SendStandaloneNotificationBasicAsync(AltinnII.Services.Notification.SendStandaloneNotificationBasicRequest request); 610 | 611 | [System.ServiceModel.OperationContractAttribute(Action="http://www.altinn.no/services/ServiceEngine/Notification/2010/10/INotificationAge" + 612 | "ncyExternalBasic/SendStandaloneNotificationBasicV2", ReplyAction="http://www.altinn.no/services/ServiceEngine/Notification/2010/10/INotificationAge" + 613 | "ncyExternalBasic/SendStandaloneNotificationBasicV2Response")] 614 | [System.ServiceModel.FaultContractAttribute(typeof(AltinnII.Services.Notification.AltinnFault), Action="http://www.altinn.no/services/ServiceEngine/Notification/2010/10/INotificationAge" + 615 | "ncyExternalBasic/SendStandaloneNotificationBasicV2AltinnFaultFault", Name="AltinnFault", Namespace="http://www.altinn.no/services/common/fault/2009/10")] 616 | System.Threading.Tasks.Task SendStandaloneNotificationBasicV2Async(AltinnII.Services.Notification.SendStandaloneNotificationBasicV2Request request); 617 | 618 | [System.ServiceModel.OperationContractAttribute(Action="http://www.altinn.no/services/ServiceEngine/Notification/2010/10/INotificationAge" + 619 | "ncyExternalBasic/SendStandaloneNotificationBasicV3", ReplyAction="http://www.altinn.no/services/ServiceEngine/Notification/2010/10/INotificationAge" + 620 | "ncyExternalBasic/SendStandaloneNotificationBasicV3Response")] 621 | [System.ServiceModel.FaultContractAttribute(typeof(AltinnII.Services.Notification.AltinnFault), Action="http://www.altinn.no/services/ServiceEngine/Notification/2010/10/INotificationAge" + 622 | "ncyExternalBasic/SendStandaloneNotificationBasicV3AltinnFaultFault", Name="AltinnFault", Namespace="http://www.altinn.no/services/common/fault/2009/10")] 623 | System.Threading.Tasks.Task SendStandaloneNotificationBasicV3Async(AltinnII.Services.Notification.SendStandaloneNotificationBasicV3Request request); 624 | } 625 | 626 | [System.Diagnostics.DebuggerStepThroughAttribute()] 627 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 628 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 629 | [System.ServiceModel.MessageContractAttribute(WrapperName="Test", WrapperNamespace="http://www.altinn.no/services/2009/10", IsWrapped=true)] 630 | internal partial class TestRequest 631 | { 632 | 633 | public TestRequest() 634 | { 635 | } 636 | } 637 | 638 | [System.Diagnostics.DebuggerStepThroughAttribute()] 639 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 640 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 641 | [System.ServiceModel.MessageContractAttribute(WrapperName="TestResponse", WrapperNamespace="http://www.altinn.no/services/2009/10", IsWrapped=true)] 642 | internal partial class TestResponse 643 | { 644 | 645 | public TestResponse() 646 | { 647 | } 648 | } 649 | 650 | [System.Diagnostics.DebuggerStepThroughAttribute()] 651 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 652 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 653 | [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] 654 | internal partial class SendStandaloneNotificationBasicRequest 655 | { 656 | 657 | [System.ServiceModel.MessageBodyMemberAttribute(Name="SendStandaloneNotificationBasic", Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10", Order=0)] 658 | public AltinnII.Services.Notification.SendStandaloneNotificationBasicRequestBody Body; 659 | 660 | public SendStandaloneNotificationBasicRequest() 661 | { 662 | } 663 | 664 | public SendStandaloneNotificationBasicRequest(AltinnII.Services.Notification.SendStandaloneNotificationBasicRequestBody Body) 665 | { 666 | this.Body = Body; 667 | } 668 | } 669 | 670 | [System.Diagnostics.DebuggerStepThroughAttribute()] 671 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 672 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 673 | [System.Runtime.Serialization.DataContractAttribute(Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10")] 674 | internal partial class SendStandaloneNotificationBasicRequestBody 675 | { 676 | 677 | [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)] 678 | public string systemUserName; 679 | 680 | [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=1)] 681 | public string systemPassword; 682 | 683 | [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=2)] 684 | public AltinnII.Services.Notification.StandaloneNotificationBEList standaloneNotifications; 685 | 686 | public SendStandaloneNotificationBasicRequestBody() 687 | { 688 | } 689 | 690 | public SendStandaloneNotificationBasicRequestBody(string systemUserName, string systemPassword, AltinnII.Services.Notification.StandaloneNotificationBEList standaloneNotifications) 691 | { 692 | this.systemUserName = systemUserName; 693 | this.systemPassword = systemPassword; 694 | this.standaloneNotifications = standaloneNotifications; 695 | } 696 | } 697 | 698 | [System.Diagnostics.DebuggerStepThroughAttribute()] 699 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 700 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 701 | [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] 702 | internal partial class SendStandaloneNotificationBasicResponse 703 | { 704 | 705 | [System.ServiceModel.MessageBodyMemberAttribute(Name="SendStandaloneNotificationBasicResponse", Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10", Order=0)] 706 | public AltinnII.Services.Notification.SendStandaloneNotificationBasicResponseBody Body; 707 | 708 | public SendStandaloneNotificationBasicResponse() 709 | { 710 | } 711 | 712 | public SendStandaloneNotificationBasicResponse(AltinnII.Services.Notification.SendStandaloneNotificationBasicResponseBody Body) 713 | { 714 | this.Body = Body; 715 | } 716 | } 717 | 718 | [System.Diagnostics.DebuggerStepThroughAttribute()] 719 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 720 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 721 | [System.Runtime.Serialization.DataContractAttribute()] 722 | internal partial class SendStandaloneNotificationBasicResponseBody 723 | { 724 | 725 | public SendStandaloneNotificationBasicResponseBody() 726 | { 727 | } 728 | } 729 | 730 | [System.Diagnostics.DebuggerStepThroughAttribute()] 731 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 732 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 733 | [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] 734 | internal partial class SendStandaloneNotificationBasicV2Request 735 | { 736 | 737 | [System.ServiceModel.MessageBodyMemberAttribute(Name="SendStandaloneNotificationBasicV2", Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10", Order=0)] 738 | public AltinnII.Services.Notification.SendStandaloneNotificationBasicV2RequestBody Body; 739 | 740 | public SendStandaloneNotificationBasicV2Request() 741 | { 742 | } 743 | 744 | public SendStandaloneNotificationBasicV2Request(AltinnII.Services.Notification.SendStandaloneNotificationBasicV2RequestBody Body) 745 | { 746 | this.Body = Body; 747 | } 748 | } 749 | 750 | [System.Diagnostics.DebuggerStepThroughAttribute()] 751 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 752 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 753 | [System.Runtime.Serialization.DataContractAttribute(Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10")] 754 | internal partial class SendStandaloneNotificationBasicV2RequestBody 755 | { 756 | 757 | [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)] 758 | public string systemUserName; 759 | 760 | [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=1)] 761 | public string systemPassword; 762 | 763 | [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=2)] 764 | public AltinnII.Services.Notification.StandaloneNotificationBEList standaloneNotifications; 765 | 766 | public SendStandaloneNotificationBasicV2RequestBody() 767 | { 768 | } 769 | 770 | public SendStandaloneNotificationBasicV2RequestBody(string systemUserName, string systemPassword, AltinnII.Services.Notification.StandaloneNotificationBEList standaloneNotifications) 771 | { 772 | this.systemUserName = systemUserName; 773 | this.systemPassword = systemPassword; 774 | this.standaloneNotifications = standaloneNotifications; 775 | } 776 | } 777 | 778 | [System.Diagnostics.DebuggerStepThroughAttribute()] 779 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 780 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 781 | [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] 782 | internal partial class SendStandaloneNotificationBasicV2Response 783 | { 784 | 785 | [System.ServiceModel.MessageBodyMemberAttribute(Name="SendStandaloneNotificationBasicV2Response", Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10", Order=0)] 786 | public AltinnII.Services.Notification.SendStandaloneNotificationBasicV2ResponseBody Body; 787 | 788 | public SendStandaloneNotificationBasicV2Response() 789 | { 790 | } 791 | 792 | public SendStandaloneNotificationBasicV2Response(AltinnII.Services.Notification.SendStandaloneNotificationBasicV2ResponseBody Body) 793 | { 794 | this.Body = Body; 795 | } 796 | } 797 | 798 | [System.Diagnostics.DebuggerStepThroughAttribute()] 799 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 800 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 801 | [System.Runtime.Serialization.DataContractAttribute(Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10")] 802 | internal partial class SendStandaloneNotificationBasicV2ResponseBody 803 | { 804 | 805 | [System.Runtime.Serialization.DataMemberAttribute(Order=0)] 806 | public string SendStandaloneNotificationBasicV2Result; 807 | 808 | public SendStandaloneNotificationBasicV2ResponseBody() 809 | { 810 | } 811 | 812 | public SendStandaloneNotificationBasicV2ResponseBody(string SendStandaloneNotificationBasicV2Result) 813 | { 814 | this.SendStandaloneNotificationBasicV2Result = SendStandaloneNotificationBasicV2Result; 815 | } 816 | } 817 | 818 | [System.Diagnostics.DebuggerStepThroughAttribute()] 819 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 820 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 821 | [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] 822 | internal partial class SendStandaloneNotificationBasicV3Request 823 | { 824 | 825 | [System.ServiceModel.MessageBodyMemberAttribute(Name="SendStandaloneNotificationBasicV3", Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10", Order=0)] 826 | public AltinnII.Services.Notification.SendStandaloneNotificationBasicV3RequestBody Body; 827 | 828 | public SendStandaloneNotificationBasicV3Request() 829 | { 830 | } 831 | 832 | public SendStandaloneNotificationBasicV3Request(AltinnII.Services.Notification.SendStandaloneNotificationBasicV3RequestBody Body) 833 | { 834 | this.Body = Body; 835 | } 836 | } 837 | 838 | [System.Diagnostics.DebuggerStepThroughAttribute()] 839 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 840 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 841 | [System.Runtime.Serialization.DataContractAttribute(Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10")] 842 | internal partial class SendStandaloneNotificationBasicV3RequestBody 843 | { 844 | 845 | [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)] 846 | public string systemUserName; 847 | 848 | [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=1)] 849 | public string systemPassword; 850 | 851 | [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=2)] 852 | public AltinnII.Services.Notification.StandaloneNotificationBEList standaloneNotifications; 853 | 854 | public SendStandaloneNotificationBasicV3RequestBody() 855 | { 856 | } 857 | 858 | public SendStandaloneNotificationBasicV3RequestBody(string systemUserName, string systemPassword, AltinnII.Services.Notification.StandaloneNotificationBEList standaloneNotifications) 859 | { 860 | this.systemUserName = systemUserName; 861 | this.systemPassword = systemPassword; 862 | this.standaloneNotifications = standaloneNotifications; 863 | } 864 | } 865 | 866 | [System.Diagnostics.DebuggerStepThroughAttribute()] 867 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 868 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 869 | [System.ServiceModel.MessageContractAttribute(IsWrapped=false)] 870 | internal partial class SendStandaloneNotificationBasicV3Response 871 | { 872 | 873 | [System.ServiceModel.MessageBodyMemberAttribute(Name="SendStandaloneNotificationBasicV3Response", Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10", Order=0)] 874 | public AltinnII.Services.Notification.SendStandaloneNotificationBasicV3ResponseBody Body; 875 | 876 | public SendStandaloneNotificationBasicV3Response() 877 | { 878 | } 879 | 880 | public SendStandaloneNotificationBasicV3Response(AltinnII.Services.Notification.SendStandaloneNotificationBasicV3ResponseBody Body) 881 | { 882 | this.Body = Body; 883 | } 884 | } 885 | 886 | [System.Diagnostics.DebuggerStepThroughAttribute()] 887 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 888 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 889 | [System.Runtime.Serialization.DataContractAttribute(Namespace="http://www.altinn.no/services/ServiceEngine/Notification/2010/10")] 890 | internal partial class SendStandaloneNotificationBasicV3ResponseBody 891 | { 892 | 893 | [System.Runtime.Serialization.DataMemberAttribute(Order=0)] 894 | public AltinnII.Services.Notification.SendNotificationResultList SendStandaloneNotificationBasicV3Result; 895 | 896 | public SendStandaloneNotificationBasicV3ResponseBody() 897 | { 898 | } 899 | 900 | public SendStandaloneNotificationBasicV3ResponseBody(AltinnII.Services.Notification.SendNotificationResultList SendStandaloneNotificationBasicV3Result) 901 | { 902 | this.SendStandaloneNotificationBasicV3Result = SendStandaloneNotificationBasicV3Result; 903 | } 904 | } 905 | 906 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 907 | internal interface INotificationAgencyExternalBasicChannel : AltinnII.Services.Notification.INotificationAgencyExternalBasic, System.ServiceModel.IClientChannel 908 | { 909 | } 910 | 911 | [System.Diagnostics.DebuggerStepThroughAttribute()] 912 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3")] 913 | internal partial class NotificationAgencyExternalBasicClient : System.ServiceModel.ClientBase, AltinnII.Services.Notification.INotificationAgencyExternalBasic 914 | { 915 | 916 | /// 917 | /// Implement this partial method to configure the service endpoint. 918 | /// 919 | /// The endpoint to configure 920 | /// The client credentials 921 | static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); 922 | 923 | public NotificationAgencyExternalBasicClient() : 924 | base(NotificationAgencyExternalBasicClient.GetDefaultBinding(), NotificationAgencyExternalBasicClient.GetDefaultEndpointAddress()) 925 | { 926 | this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_INotificationAgencyExternalBasic.ToString(); 927 | ConfigureEndpoint(this.Endpoint, this.ClientCredentials); 928 | } 929 | 930 | public NotificationAgencyExternalBasicClient(EndpointConfiguration endpointConfiguration) : 931 | base(NotificationAgencyExternalBasicClient.GetBindingForEndpoint(endpointConfiguration), NotificationAgencyExternalBasicClient.GetEndpointAddress(endpointConfiguration)) 932 | { 933 | this.Endpoint.Name = endpointConfiguration.ToString(); 934 | ConfigureEndpoint(this.Endpoint, this.ClientCredentials); 935 | } 936 | 937 | public NotificationAgencyExternalBasicClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : 938 | base(NotificationAgencyExternalBasicClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) 939 | { 940 | this.Endpoint.Name = endpointConfiguration.ToString(); 941 | ConfigureEndpoint(this.Endpoint, this.ClientCredentials); 942 | } 943 | 944 | public NotificationAgencyExternalBasicClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : 945 | base(NotificationAgencyExternalBasicClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) 946 | { 947 | this.Endpoint.Name = endpointConfiguration.ToString(); 948 | ConfigureEndpoint(this.Endpoint, this.ClientCredentials); 949 | } 950 | 951 | public NotificationAgencyExternalBasicClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 952 | base(binding, remoteAddress) 953 | { 954 | } 955 | 956 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 957 | System.Threading.Tasks.Task AltinnII.Services.Notification.INotificationAgencyExternalBasic.TestAsync(AltinnII.Services.Notification.TestRequest request) 958 | { 959 | return base.Channel.TestAsync(request); 960 | } 961 | 962 | public System.Threading.Tasks.Task TestAsync() 963 | { 964 | AltinnII.Services.Notification.TestRequest inValue = new AltinnII.Services.Notification.TestRequest(); 965 | return ((AltinnII.Services.Notification.INotificationAgencyExternalBasic)(this)).TestAsync(inValue); 966 | } 967 | 968 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 969 | System.Threading.Tasks.Task AltinnII.Services.Notification.INotificationAgencyExternalBasic.SendStandaloneNotificationBasicAsync(AltinnII.Services.Notification.SendStandaloneNotificationBasicRequest request) 970 | { 971 | return base.Channel.SendStandaloneNotificationBasicAsync(request); 972 | } 973 | 974 | public System.Threading.Tasks.Task SendStandaloneNotificationBasicAsync(string systemUserName, string systemPassword, AltinnII.Services.Notification.StandaloneNotificationBEList standaloneNotifications) 975 | { 976 | AltinnII.Services.Notification.SendStandaloneNotificationBasicRequest inValue = new AltinnII.Services.Notification.SendStandaloneNotificationBasicRequest(); 977 | inValue.Body = new AltinnII.Services.Notification.SendStandaloneNotificationBasicRequestBody(); 978 | inValue.Body.systemUserName = systemUserName; 979 | inValue.Body.systemPassword = systemPassword; 980 | inValue.Body.standaloneNotifications = standaloneNotifications; 981 | return ((AltinnII.Services.Notification.INotificationAgencyExternalBasic)(this)).SendStandaloneNotificationBasicAsync(inValue); 982 | } 983 | 984 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 985 | System.Threading.Tasks.Task AltinnII.Services.Notification.INotificationAgencyExternalBasic.SendStandaloneNotificationBasicV2Async(AltinnII.Services.Notification.SendStandaloneNotificationBasicV2Request request) 986 | { 987 | return base.Channel.SendStandaloneNotificationBasicV2Async(request); 988 | } 989 | 990 | public System.Threading.Tasks.Task SendStandaloneNotificationBasicV2Async(string systemUserName, string systemPassword, AltinnII.Services.Notification.StandaloneNotificationBEList standaloneNotifications) 991 | { 992 | AltinnII.Services.Notification.SendStandaloneNotificationBasicV2Request inValue = new AltinnII.Services.Notification.SendStandaloneNotificationBasicV2Request(); 993 | inValue.Body = new AltinnII.Services.Notification.SendStandaloneNotificationBasicV2RequestBody(); 994 | inValue.Body.systemUserName = systemUserName; 995 | inValue.Body.systemPassword = systemPassword; 996 | inValue.Body.standaloneNotifications = standaloneNotifications; 997 | return ((AltinnII.Services.Notification.INotificationAgencyExternalBasic)(this)).SendStandaloneNotificationBasicV2Async(inValue); 998 | } 999 | 1000 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] 1001 | System.Threading.Tasks.Task AltinnII.Services.Notification.INotificationAgencyExternalBasic.SendStandaloneNotificationBasicV3Async(AltinnII.Services.Notification.SendStandaloneNotificationBasicV3Request request) 1002 | { 1003 | return base.Channel.SendStandaloneNotificationBasicV3Async(request); 1004 | } 1005 | 1006 | public System.Threading.Tasks.Task SendStandaloneNotificationBasicV3Async(string systemUserName, string systemPassword, AltinnII.Services.Notification.StandaloneNotificationBEList standaloneNotifications) 1007 | { 1008 | AltinnII.Services.Notification.SendStandaloneNotificationBasicV3Request inValue = new AltinnII.Services.Notification.SendStandaloneNotificationBasicV3Request(); 1009 | inValue.Body = new AltinnII.Services.Notification.SendStandaloneNotificationBasicV3RequestBody(); 1010 | inValue.Body.systemUserName = systemUserName; 1011 | inValue.Body.systemPassword = systemPassword; 1012 | inValue.Body.standaloneNotifications = standaloneNotifications; 1013 | return ((AltinnII.Services.Notification.INotificationAgencyExternalBasic)(this)).SendStandaloneNotificationBasicV3Async(inValue); 1014 | } 1015 | 1016 | public virtual System.Threading.Tasks.Task OpenAsync() 1017 | { 1018 | return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); 1019 | } 1020 | 1021 | public virtual System.Threading.Tasks.Task CloseAsync() 1022 | { 1023 | return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); 1024 | } 1025 | 1026 | private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) 1027 | { 1028 | if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_INotificationAgencyExternalBasic)) 1029 | { 1030 | System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); 1031 | result.MaxBufferSize = int.MaxValue; 1032 | result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; 1033 | result.MaxReceivedMessageSize = int.MaxValue; 1034 | result.AllowCookies = true; 1035 | result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport; 1036 | return result; 1037 | } 1038 | throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); 1039 | } 1040 | 1041 | private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) 1042 | { 1043 | if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_INotificationAgencyExternalBasic)) 1044 | { 1045 | return new System.ServiceModel.EndpointAddress("https://www.altinn.no/ServiceEngineExternal/NotificationAgencyExternalBasic.svc"); 1046 | } 1047 | throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); 1048 | } 1049 | 1050 | private static System.ServiceModel.Channels.Binding GetDefaultBinding() 1051 | { 1052 | return NotificationAgencyExternalBasicClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_INotificationAgencyExternalBasic); 1053 | } 1054 | 1055 | private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() 1056 | { 1057 | return NotificationAgencyExternalBasicClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_INotificationAgencyExternalBasic); 1058 | } 1059 | 1060 | public enum EndpointConfiguration 1061 | { 1062 | 1063 | BasicHttpBinding_INotificationAgencyExternalBasic, 1064 | } 1065 | } 1066 | } 1067 | --------------------------------------------------------------------------------