Eine Hürde für .NET Entwickler ist, dass das Webservice für die Authentifizierung einen SOAP-Header im folgenden Format verlangt (spitz durch eckig ersetzt):
[font='Courier New, Courier, mono'][env:Header][/font]
[font='Courier New, Courier, mono']..[wsse:Security][/font]
[font='Courier New, Courier, mono']....[wsse:UsernameToken][/font]
[font='Courier New, Courier, mono']......[wsse:Username]Testkonto[/wsse:Username][/font]
[font='Courier New, Courier, mono']......[wsse:Password]a1b2c3d4[/wsse:Password][/font]
[font='Courier New, Courier, mono']....[/wsse:UsernameToken][/font]
[font='Courier New, Courier, mono']...[/wsse:Security][/font]
[font='Courier New, Courier, mono'][/env:Header][/font]
(wie unter [color=green]Die eRechnung als XML[/color][color=gray]</param>[/color]
[color=gray]///[/color][color=green] [/color][color=gray]<param name="test">[/color][color=green]Wenn angegeben, wird die Nachricht beim Empfänger verworfen (eine Prüfung findet statt)[/color][color=gray]</param>[/color]
/// <param name="serviceUrl">Url des Webservice. Also: https://txm.portal.at/at.gv.bmf.erb/V2</param>
/// <param name="serviceUser">Benutzername für das Webservice</param>
/// <param name="servicePassword">Passwort für das Webservice</param>
[color=blue]public[/color] [color=blue]static[/color] [color=blue]void[/color] Send([color=blue]string[/color] xml, [color=blue]bool[/color] test, [color=blue]string [/color]serviceUrl, [color=blue]string[/color] serviceUser, [color=blue]string[/color] servicePassword)
{
[color=green]//Xml zu Base64 konvertieren[/color]
[color=blue]byte[/color][] content = [color=blue]null[/color];
try
{
content = System.Text.[color=#2B91AF]Encoding[/color].UTF8.GetBytes(xml);
}
[color=blue]catch[/color] ([color=#2B91AF]Exception [/color]ex)
{
[color=green]//...[/color]
}
#region " SOAP-Header Class für Security "
https://txm.portal.at/at.gv.bmf.erb/V2
https://txm.portal.at/at.gv.bmf.erb/V2