Skip to content
Snippets Groups Projects
Commit 178b5500 authored by Klaus Fischer's avatar Klaus Fischer
Browse files

added uri

parent 1138a610
No related branches found
No related tags found
No related merge requests found
// See https://aka.ms/new-console-template for more information
using ConsoleAppExample;
using FitConnect.Models;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
......@@ -28,9 +29,17 @@ logger.LogInformation("Starting FIT-Connect");
//await SenderDemo.Run(config, logger);
//await SubscriberDemo.Run(config, logger);
var (submissionId, caseId) = await SenderDemo.SimpleSend(config,Guid.Parse("f726bcdd-2296-4863-ae52-570c67eee0ce"),
var body = File.ReadAllText("/Users/kfischer/Downloads/TestDatei.xml");
body = body.Replace("\r\n\r\n", "");
Console.WriteLine(body.Length);
var (submissionId, caseId, sender) = await SenderDemo.SimpleSend(config,Guid.Parse("f726bcdd-2296-4863-ae52-570c67eee0ce"),
"urn:de:fim:leika:leistung:99102013000000",
File.ReadAllText("/Users/kfischer/Downloads/TestDatei.xml"),
"/Users/kfischer/Documents/ScanSnap Home folder/27092024.pdf"
body,
"/Users/kfischer/development/customer/fitko/FIT-Connect/sdk-dotnet/Examples/ConsoleAppExample/Test_2.pdf"
, logger);
File.AppendText("./submissionIds.txt").Write(submissionId + "\n");
using System.Net.Mime;
using FitConnect;
using FitConnect.Encryption;
using FitConnect.Interfaces;
using FitConnect.Models;
using FitConnect.Models.Api.Metadata;
using FitConnect.Models.Api.Set;
......@@ -116,13 +117,13 @@ public static class SenderDemo {
.SendAsync(sendableEncryptedSubmission);
}
public static async Task<(Guid SubmissionId, Guid CaseId)> SimpleSend(IConfigurationRoot config, Guid destination, string serviceType, string data,
public static async Task<(Guid SubmissionId, Guid CaseId, ISender)> SimpleSend(IConfigurationRoot config, Guid destination, string serviceType, string data,
string attachment,
ILogger logger) {
var sendableSubmission = SendableSubmission.Builder()
.SetDestination(destination)
.SetServiceType(serviceType, "FIT Connect Demo")
.SetXmlData(data, new Uri("https://schema.example.com"))
.SetXmlData(data, new Uri("urn:de:govos:data"))
.AddAttachments(Attachment.FromPath(attachment, "application/pdf"))
.Build();
......@@ -151,6 +152,6 @@ public static class SenderDemo {
var status = await sender.GetStatusForSubmissionAsync(sentSubmission);
logger.LogInformation("Status for {submission} is {status}",sentSubmission.SubmissionId, status.SubmissionState.ToString());
return (sentSubmission.SubmissionId, sentSubmission.CaseId);
return (sentSubmission.SubmissionId, sentSubmission.CaseId, sender);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment