This is a .NET console application with a SOAP client for the Slovenian eDavki (eTax) system.
The SOAP client is generated from:
https://edavki.durs.si/SoapPortal/EDPSoapService.asmx?WSDL
- Program.cs - Main application with example of how to use the SOAP client
- ServiceReference/ServiceReference.cs - Auto-generated SOAP client code
- EdavkiSoapClient.csproj - Project file with NuGet package references
The project uses the following NuGet packages:
- System.ServiceModel.Http - SOAP/WCF HTTP communication
- System.ServiceModel.Primitives - Core WCF types
- System.Security.Cryptography.Xml - XML digital signature support
The application includes a complete implementation of the LoginUsingServerCertificate method with:
- XML Digital Signature: Signs login requests according to XMLDSig standard
- Certificate Support: Uses PKCS#12 (.p12) certificates for signing
- Schema Compliance: Follows the SOAPLogin_1.xsd schema structure
- Error Handling: Comprehensive error handling and validation
See USAGE_EXAMPLE.md for detailed usage instructions.
// Login with server certificate
string response = await LoginWithServerCertificate(
certificatePassword: "your_password",
taxNumber: 12345678,
taxPayerType: "FO", // "FO" for individuals, "PO" for legal entities
sessionDurationMinutes: 15
);cd EdavkiSoapClient
dotnet runcd EdavkiSoapClient
dotnet buildThe service provides various operations including:
LoginUsingClientCertificate- Login using client certificateLoginUsingServerCertificate- Login using server certificateLogout- Logout from the service
GetNewDocument- Get a new documentGetNewDocumentForPeriod- Get a new document for a specific periodGetNewDocumentForDate- Get a new document for a specific dateCheckDocumentErrors- Check document for errorsCheckDocumentErrorsWithAttachments- Check document with attachmentsCalculateDocumentData- Calculate document dataDepositDocument- Deposit a documentDepositDocumentWithAttachments- Deposit document with attachments
And many more operations...
using EdavkiSoapClient.ServiceReference;
using System.ServiceModel;
// Create a binding configuration
var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
binding.MaxReceivedMessageSize = 2147483647;
binding.MaxBufferSize = 2147483647;
// Create the endpoint address
var endpoint = new EndpointAddress("https://edavki.durs.si/SoapPortal/EDPSoapService.asmx");
// Create and use the client
using (var client = new EdpSoapServiceSoapClient(binding, endpoint))
{
// Call SOAP operations
// var response = await client.GetNewDocumentAsync(request);
}If you need to regenerate the service reference:
dotnet-svcutil https://edavki.durs.si/SoapPortal/EDPSoapService.asmx?WSDL -n "*,EdavkiSoapClient.ServiceReference" -o ServiceReference.csThis client connects to the production eDavki service. Make sure you have proper credentials and certificates when using authentication-required operations.