76 lines
3.4 KiB
VB.net
76 lines
3.4 KiB
VB.net
'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
|