uta
This commit is contained in:
75
VERAG_PROG_ALLGEMEIN/Schnittstellen/BZST/cBZST_UID_XML.vb
Normal file
75
VERAG_PROG_ALLGEMEIN/Schnittstellen/BZST/cBZST_UID_XML.vb
Normal file
@@ -0,0 +1,75 @@
|
||||
'VERALTET!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
'Imports CookComputing.XmlRpc
|
||||
|
||||
'Public Interface IEvatR
|
||||
' <XmlRpcMethod("evatrRPC.checkVatSimple")>
|
||||
' Function CheckVatSimple(tnID As String, ländercode As String, ustid As String) As XmlRpcStruct
|
||||
|
||||
' <XmlRpcMethod("evatrRPC.checkVatQualified")>
|
||||
' Function CheckVatQualified(tnID As String, ländercode As String, ustid As String,
|
||||
' firmenname As String, ort As String, plz As String, strasse As String) As XmlRpcStruct
|
||||
'End Interface
|
||||
|
||||
'Public Class cBZST_UID_XML
|
||||
|
||||
' Shared tnid As String = "DE813570890" ' BZSt Teilnehmer-ID
|
||||
|
||||
' Public Sub TEST()
|
||||
' ' Zum manuellen Testen
|
||||
' Dim gültig1 = checkVATSimple("AT", "U12345678")
|
||||
' Console.WriteLine("checkVATSimple returned: " & gültig1)
|
||||
|
||||
' Dim gültig2 = checkVATQualified("DE", "123456789", "Beispielfirma GmbH", "Musterstadt", "12345", "Musterstraße 1")
|
||||
' Console.WriteLine("checkVATQualified returned: " & gültig2)
|
||||
' End Sub
|
||||
|
||||
' Public Shared Function checkVATSimple(ByVal countryCode As String, ByVal vatNumber As String) As Boolean
|
||||
' Try
|
||||
' Console.WriteLine("==== Einfache UID-Abfrage ====")
|
||||
' Dim proxy = XmlRpcProxyGen.Create(Of IEvatR)()
|
||||
' Dim client = CType(proxy, XmlRpcClientProtocol)
|
||||
' client.Url = "https://evatr.bzst.de/eVatR/xmlrpc"
|
||||
' client.XmlEncoding = System.Text.Encoding.UTF8
|
||||
|
||||
' Dim res As XmlRpcStruct = proxy.CheckVatSimple(tnid, countryCode, vatNumber)
|
||||
' Console.WriteLine("Land: " & countryCode)
|
||||
' Console.WriteLine("USt-IdNr.: " & vatNumber)
|
||||
' Console.WriteLine("Ergebniscode: " & res("erg_code"))
|
||||
' Console.WriteLine("Ergebnistext: " & res("erg_text"))
|
||||
' Console.WriteLine("Gültig: " & res("gueltig"))
|
||||
|
||||
' Return Convert.ToBoolean(res("gueltig"))
|
||||
' Catch ex As Exception
|
||||
' Console.WriteLine("Fehler bei einfacher Prüfung: " & ex.Message)
|
||||
' Return False
|
||||
' End Try
|
||||
' End Function
|
||||
|
||||
' Public Shared Function checkVATQualified(ByVal countryCode As String, ByVal vatNumber As String,
|
||||
' ByVal companyName As String, ByVal city As String,
|
||||
' ByVal postalCode As String, ByVal street As String) As Boolean
|
||||
' Try
|
||||
' Dim proxy = XmlRpcProxyGen.Create(Of IEvatR)()
|
||||
' Dim client = CType(proxy, XmlRpcClientProtocol)
|
||||
' client.Url = "https://evatr.bzst.de/eVatR/xmlrpc"
|
||||
' client.XmlEncoding = System.Text.Encoding.UTF8
|
||||
|
||||
' Dim res As XmlRpcStruct = proxy.CheckVatQualified(tnid, countryCode, vatNumber, companyName, city, postalCode, street)
|
||||
|
||||
' Console.WriteLine("==== Qualifizierte UID-Abfrage ====")
|
||||
' Console.WriteLine("Land: " & countryCode)
|
||||
' Console.WriteLine("USt-IdNr.: " & vatNumber)
|
||||
' Console.WriteLine("Firma: " & companyName)
|
||||
' Console.WriteLine("Adresse: " & street & ", " & postalCode & " " & city)
|
||||
' Console.WriteLine("Ergebniscode: " & res("erg_code"))
|
||||
' Console.WriteLine("Ergebnistext: " & res("erg_text"))
|
||||
' Console.WriteLine("Gültig: " & res("gueltig"))
|
||||
|
||||
' Return Convert.ToBoolean(res("gueltig"))
|
||||
' Catch ex As Exception
|
||||
' Console.WriteLine("Fehler bei qualifizierter Prüfung: " & ex.Message)
|
||||
' Return False
|
||||
' End Try
|
||||
' End Function
|
||||
|
||||
'End Class
|
||||
Reference in New Issue
Block a user