Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FIT-Connect-SDK - .NET
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FIT-Connect
FIT-Connect-SDK - .NET
Commits
178b5500
Commit
178b5500
authored
4 months ago
by
Klaus Fischer
Browse files
Options
Downloads
Patches
Plain Diff
added uri
parent
1138a610
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Examples/ConsoleAppExample/Program.cs
+12
-3
12 additions, 3 deletions
Examples/ConsoleAppExample/Program.cs
Examples/ConsoleAppExample/SenderDemo.cs
+4
-3
4 additions, 3 deletions
Examples/ConsoleAppExample/SenderDemo.cs
with
16 additions
and
6 deletions
Examples/ConsoleAppExample/Program.cs
+
12
−
3
View file @
178b5500
// 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"
);
This diff is collapsed.
Click to expand it.
Examples/ConsoleAppExample/SenderDemo.cs
+
4
−
3
View file @
178b5500
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment