Skip to content

docknight/edavki-soap-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EDavki SOAP Client

This is a .NET console application with a SOAP client for the Slovenian eDavki (eTax) system.

WSDL Endpoint

The SOAP client is generated from:

https://edavki.durs.si/SoapPortal/EDPSoapService.asmx?WSDL

Project Structure

  • 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

Dependencies

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

Features

✅ Implemented: LoginUsingServerCertificate

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.

Quick Example

// Login with server certificate
string response = await LoginWithServerCertificate(
    certificatePassword: "your_password",
    taxNumber: 12345678,
    taxPayerType: "FO", // "FO" for individuals, "PO" for legal entities
    sessionDurationMinutes: 15
);

How to Run

cd EdavkiSoapClient
dotnet run

How to Build

cd EdavkiSoapClient
dotnet build

Available SOAP Operations

The service provides various operations including:

Authentication

  • LoginUsingClientCertificate - Login using client certificate
  • LoginUsingServerCertificate - Login using server certificate
  • Logout - Logout from the service

Document Operations

  • GetNewDocument - Get a new document
  • GetNewDocumentForPeriod - Get a new document for a specific period
  • GetNewDocumentForDate - Get a new document for a specific date
  • CheckDocumentErrors - Check document for errors
  • CheckDocumentErrorsWithAttachments - Check document with attachments
  • CalculateDocumentData - Calculate document data
  • DepositDocument - Deposit a document
  • DepositDocumentWithAttachments - Deposit document with attachments

And many more operations...

Usage Example

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);
}

Regenerating the Service Reference

If you need to regenerate the service reference:

dotnet-svcutil https://edavki.durs.si/SoapPortal/EDPSoapService.asmx?WSDL -n "*,EdavkiSoapClient.ServiceReference" -o ServiceReference.cs

Note

This client connects to the production eDavki service. Make sure you have proper credentials and certificates when using authentication-required operations.

About

SOAP client for the Slovenian eDavki (eTax) system

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages