Expand description
§dmvs
A high-level asynchronous Rust client for a focused set of consumer-facing ČÚZK DMVS SOAP services.
The crate uses explicit integration/production environments, fixed HTTPS endpoints, mutual TLS with a PEM certificate chain and private key, an explicit requester subject, namespace-aware SOAP 1.1 decoding, correlated request UUIDs, typed service errors, bounded responses, and raw-preserving protocol values. Production is never the default.
The public geometry API uses geo-types; consumers can interoperate with the broader geo crate through its re-exported geometry types. Coordinates and CRS are preserved without implicit axis swaps or reprojection.
§Installation
cargo add dmvsThe crate is pre-1.0, so API changes may occur between minor releases. Rust 1.89 or newer is supported. The reqwest/rustls backend may require a supported C/CMake toolchain for its bundled native components.
§Supported services and operations
The supported surface is exactly 5 services and 18 official operations. Each official operation below has one public Client method; explicitly named convenience helpers are listed separately. Partial services contain only the operations shown, not every operation in their WSDL.
The client does not infer registration, role, or legal eligibility; ČÚZK remains authoritative. R19 submissions and R49 inquiries can create server-side jobs. Non-public R19 is available to eligible downstream consumers, but supplying a requester status or evidence never establishes eligibility.
| Service | Eligibility and deployment notes | Official operation → public method |
|---|---|---|
| R18a — affected infrastructure respondents (1) | Any registered subject. | ctiVyjadrovatele → list_infrastructure_respondents |
| R18b — subject lookup (4) | Any registered subject for these general-reader calls; excludes territory/scope searches requiring special roles. | ctiSubjekt → read_subjectctiSubjektDleIco → read_subject_by_organization_numberctiSubjektyDleIdentifikace → search_subjectsctiSubjektyDleCasti → list_infrastructure_part_subjects |
| R19 — custom-area DTM datasets (4) | Public submission/result operations are included. Non-public operations require the applicable documented registration/eligibility, requester status, and evidence where required; the server decides eligibility. | vyhotovVerejnouDatovouSadu → submit_public_custom_area_datasetctiVysledekVyhotovVerejnouDatovouSadu → read_public_custom_area_dataset_resultvyhotovNeverejnouDatovouSadu → submit_non_public_custom_area_datasetctiVysledekVyhotovNeverejnouDatovouSadu → read_non_public_custom_area_dataset_result |
| R24a — central code lists/configuration (5) | Any registered subject. | vylistujCiselniky → list_code_listsctiCiselnik → read_code_listvylistujVerzeJvf → list_jvf_versionsctiVerziJvf → read_jvf_versionvylistujCertifikatyIsDmvs → list_is_dmvs_certificates |
| R49 — infrastructure managers in a territory (4) | Any registered subject for the selected central workflow. Documentation conflicts about Design/Produkce are recorded in SCHEMAS.md. | zjistiUzemiSpravcuDti → submit_infrastructure_manager_inquiryctiVysledekZjistiUzemiSpravcuDti → read_infrastructure_manager_inquiry_resultctiVysledekZjistiUzemiSpravcuDtiSeznamCastiDti → list_infrastructure_manager_inquiry_partsctiVysledekZjistiUzemiSpravcuDtiReport → read_infrastructure_manager_inquiry_report |
For non-public R19, NonPublicRequesterStatus::ApplicantByApplication (ZadatelDleZadosti) requires genuine supporting evidence. Other genuine qualifying requester statuses use the same two non-public operations; they are not separate endpoints.
Convenience methods do not add protocol operations. The only convenience waits are wait_for_public_custom_area_dataset, wait_for_non_public_custom_area_dataset, and wait_for_infrastructure_manager_inquiry, which poll the corresponding existing R19 or R49 result operation. No other convenience pagination or polling helpers are provided.
§Environments
Environment::Integrationselectshttps://dmvs-i.cuzk.gov.cz:8443/api/ws/v1; INTEG accepts the documented PostSignum test or production certificate.Environment::Productionselectshttps://dmvs.cuzk.gov.cz:8443/api/ws/v1; production requires an accepted registered client certificate. It must be selected explicitly and is never a default.- Endpoint construction is not a claim of continuing deployment or authorization. See SCHEMAS.md for protocol provenance and documentation discrepancies.
§Quick start
Construction performs no network request. Both the TLS identity and requester subject are required; .build() fails if either is missing. This example lists JVF versions through R24a vylistujVerzeJvf:
use dmvs::{Client, Environment, SubjectId, TlsIdentity};
async fn example() -> Result<(), Box<dyn std::error::Error>> {
let certificate_chain = std::fs::read_to_string("certificate-chain.pem")?;
let private_key = std::fs::read_to_string("private-key.pem")?;
let subject_id = SubjectId::new(std::env::var("DMVS_SUBJECT")?)?;
let client = Client::builder(Environment::Integration)
.identity(TlsIdentity::from_pem(certificate_chain, private_key))
.subject_id(subject_id)
.build()?;
let versions = client.list_jvf_versions().await?;
for version in versions.value {
println!("{}: {}", version.version, version.description);
}
Ok(())
}Client::subject_id() returns the configured &SubjectId. Use your operating system’s secret store rather than embedding private keys in source, and do not log real subject identifiers. TlsIdentity supports an unencrypted RSA PKCS#8 PEM key and certificate chain; other rustls-compatible key encodings are accepted only when covered by tests.
§Requester-subject semantics
The configured subject is an explicit authenticated/requester identity for business payloads. It is not inferred from the certificate and is not sent in HTTP or SOAP headers. Mutual TLS still authenticates the transport independently.
- R19 public/non-public submissions and R49 inquiries automatically serialize the client subject into their requester/subject elements.
- R18a and R24a do not serialize the client subject.
- R18b lookup arguments remain per-call targets. In particular,
read_subject’sSubjectIdargument identifies the subject to look up; it is not replaced by the client’s subject.
§Request constructors
InfrastructureManagerInquiryRequest::new(selector, identification)creates an R49 inquiry;.with_notification_email(...)is optional.PublicCustomAreaDatasetRequest::new(valid_on, contents, area, format)creates a public R19 request;.with_notification_email(...)and.with_regions(...)are optional.NonPublicCustomAreaDatasetRequest::new(status, evidence, contents, valid_on, area, format)creates a non-public R19 request;.with_notification_email(...)and.with_regions(...)are optional.ZadatelDleZadostirequires evidence.
§Datasets, limits, and asynchronous recovery
§Content and request limits
- Public R19 uses
PublicCustomAreaDatasetContent::{Di, Zps}.Tiis not representable in the public request type. Non-public R19 usesNonPublicDatasetContent::{Di, Ti}. - Non-public requester status, purpose, optional legal reference, and conditionally required evidence are typed.
ZadatelDleZadostirequires genuine evidence; supplying it never establishes eligibility, and other qualifying statuses are available through the same operation. - R19 public/non-public custom areas and R49 area selectors have a 200 ha (2,000,000 m²) maximum, checked as planar S-JTSK area where possible. Server-side validation still applies.
- R49 selects either one S-JTSK area or 1–400 RÚIAN parcel IDs, never both.
PageRequestis zero-based offset pagination with a limit of 1–250 and optional total count. R18a, R18b subject search, and R49 part-list calls retrieve only their requested page; no method auto-paginates. R49 prose is ambiguous between “250” and “fewer than 250”: the shared model permits 250, but use at most 249 when following the stricter wording.- DMVS general and service-specific call quotas are server-enforced. The client’s concurrency/byte limits are local resource controls, not a reliable distributed quota mechanism.
ClientBuilder::max_request_bytesbounds the complete encoded SOAP/MTOM request during serialization, including MIME headers and attachments. The default is 64 MiB, and zero is rejected.
§Polling and recovery
- R19 and R49 submissions are attempted exactly once. There are no automatic retries. An uncertain dispatch may already have created a server-side job; do not blindly resubmit after
SubmissionUncertain. - Persist the returned opaque
RequestIdsecurely. If a valid decoded response has an unexpected state but already contains an ID,SubmissionUncertainWithRecoveryandError::recovery()retain the complete response as redactedSubmissionRecovery, allowing recovery without another submission. Every submission also has asubmit_*_with_correlation_idvariant for explicit SOAP correlation; that UUID does not replace the server-issued request ID. - Submission, one-shot result reads, waiting, R49 part/report reads, and downloads are independent; recovery by a persisted ID does not submit again.
WaitOptionsbounds the initial delay, total deadline, and fixed/backoff pacing. The default and minimum polling interval are 60 seconds; shorter intervals are rejected. Waiting spawns no background task, does not outlive its deadline, never resubmits, and never downloads datasets or retrieves R49 part pages or the PDF implicitly.- Every regional R19 state/rejection and every requested R49 result remains visible. Read each required page and result explicitly rather than assuming the first region or overall status represents all outcomes.
- R19 dataset results expose preparation and expiry metadata. Use
available_until(DostupneDo) for each returned dataset; documented regional URLs normally expire after ten days, but the metadata—not a hard-coded lifetime—is authoritative.
§Files, MTOM, and downloads
Applicable R18a supporting files, R24a JVF files, and R49 PDF reports are decoded from inline base64 or MTOM/XOP responses with independent XML, MIME, decoded-file, and aggregate limits. Non-public R19 evidence uses bounded request-side MTOM with safe file names and either a caller-supplied raw checksum declaration or computed SHA-256 metadata. The evidence bytes are carried in a separate application/octet-stream MIME part, not inside the SOAP root XML.
Returned R19 URLs are never fetched implicitly. The separate DatasetDownloader performs only explicitly initiated HTTPS downloads, with redirects/retries disabled, configurable time/byte limits, buffered or caller-sink streaming, and optional size/checksum checks. It uses a separate credential-free HTTP client with ambient system proxies disabled and never inherits or forwards the SOAP client’s mTLS identity, headers, cookies, proxy credentials, or other credentials.
A checksum is not a digital signature. Algorithms are verified only when explicitly declared and supported, or when the caller explicitly selects SHA-256; R49’s bare 64-hex example is not assumed to be SHA-256. The crate does not provide an R29/R35 callback server, JVF/DGN/SHP/GPKG/PDF-internal parsing, GIS processing, archive extraction, or cryptographic signature verification/parsing.
§Examples
All examples compile offline. Running them may contact DMVS, submit a job, or download a URL. Read each file’s header and use only authorized, non-sensitive inputs. Network examples use examples/common/mod.rs, which accepts PEM contents from DMVS_CERTIFICATE_CHAIN and DMVS_PRIVATE_KEY or PEM paths from DMVS_CERTIFICATE_CHAIN_PEM and DMVS_PRIVATE_KEY_PEM; DMVS_SUBJECT supplies the required subject. DMVS_ENVIRONMENT defaults to integration, and only exact production selects production.
| Example | Purpose |
|---|---|
subject_lookup | One R18b subject read without printing personal details. |
jvf_versions | R24a JVF-version discovery. |
public_custom_area | One public R19 DI submission and durable-ID handoff. |
non_public_custom_area | Non-public R19 DI/TI requester/evidence model. |
dataset_recovery | R19 result recovery by persisted ID and explicit downloads. |
dataset_download_to | Bounded, credential-free streaming to a temporary sink. |
infrastructure_manager_inquiry | R49 submission, bounded wait, and separately opted-in report read. |
§Optional features
serde: validated string serialization/deserialization for identifiers and correlation UUIDs.tracing: privacy-safe operation, environment, HTTP-status, and byte-count instrumentation. The application configures its own subscriber. Keys, XML, personal data, identifiers, polygons, URLs, and payloads are excluded.
§Safety and compatibility
- No redirects, automatic HTTP retries, arbitrary production endpoints, or disabled TLS verification.
- Every SOAP response is correlated to its request UUID and decoded with XML node/depth and byte limits.
- Server message text remains explicitly available in models but is redacted from normal error/debug output.
- Unknown states, severities, codes, and other protocol values are preserved rather than discarded.
- Normal tests and CI are offline and credential-free. Live tests are ignored by default and never part of routine checks.
§Live tests
The single separately authorized, read-only R24a smoke target is in tests/live.rs. It performs no submissions, polling, or downloads. Select the environment explicitly with DMVS_ENVIRONMENT=integration or DMVS_ENVIRONMENT=production; there is no default. INTEG loads the gitignored .env.integ, while production loads the gitignored .env. The selector and DMVS_RUN_LIVE_TESTS=1 opt-in must be process environment variables. Credential values may come from the selected file or process environment:
DMVS_SUBJECT: authorized test subject identifier required by client construction;DMVS_PRIVATE_KEY: unencrypted RSA PKCS#8 private-key PEM contents, not a path;DMVS_CERTIFICATE_CHAIN: client certificate-chain PEM contents, not a path.
Never commit .env, .env.integ, credentials, real subject identifiers, private records, or live response content. Normal test runs leave the live target ignored.
After explicit INTEG authorization, run:
DMVS_RUN_LIVE_TESTS=1 DMVS_ENVIRONMENT=integration cargo test --test live -- --ignored --test-threads=1Run production only after a separate, explicit production-test request; INTEG authorization is not production authorization. Then run:
DMVS_RUN_LIVE_TESTS=1 DMVS_ENVIRONMENT=production cargo test --test live -- --ignored --test-threads=1§Development
See CONTRIBUTING.md for the verification matrix and live-test safety, SCHEMAS.md for official protocol provenance and known documentation discrepancies, and CHANGELOG.md for changes.
The final public repository is github.com/interaso/dmvs. Development may use another remote before the first release; package metadata always refers to the final GitHub location.
§Official references
§License
Licensed under the MIT License (LICENSE or https://opensource.org/licenses/MIT).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate is licensed under the MIT License, without additional terms or conditions.
Structs§
- Area
- A validated polygon or multipolygon with an explicit coordinate reference system.
- Checksum
- A checksum value exactly as declared by DMVS.
- Client
- A concurrent, asynchronous DMVS client.
- Client
Builder - Builder for an asynchronous DMVS client.
- Code
List - A selected code-list version returned by R24a
ctiCiselnik. - Code
List Attribute - Metadata for one attribute of a DMVS code list.
- Code
List Attribute Reference - A reference from one code-list attribute to an attribute of another code list.
- Code
List Info - Code-list discovery metadata returned by R24a
vylistujCiselniky. - Code
List Item - One item in a selected code-list version.
- Code
List Item Attribute - One attribute value in a code-list item.
- Code
List Version Info - Version metadata for a DMVS code list.
- Correlation
Id - A UUID used to correlate one SOAP request and response.
- Custom
Area Dataset - One custom-area dataset returned by R19.
- Custom
Area Dataset Region Result - One R19 regional result, including mixed outcome and optional dataset metadata.
- Custom
Area Dataset Result - Data returned by either R19 custom-area result operation.
- Dataset
Downloader - Separate HTTPS downloader for URLs returned by DMVS.
- Dataset
Downloader Builder - Builder for
DatasetDownloader. - Dataset
Evidence - Purpose, optional legal reference, and required file for a non-public request.
- Dataset
Submission Id - The
IdPodanivalue returned with dataset results. - Download
Expectation - Optional integrity expectations for an explicitly requested dataset download.
- Download
Summary - Summary returned after streaming a dataset to a caller-provided sink.
- Downloaded
Dataset - A bounded, buffered dataset download.
- File
Metadata - File metadata returned by DMVS, independent of its payload bytes.
- File
Payload - A bounded output file with original bytes and all protocol metadata.
- Free
Address - A free-form postal address.
- Infrastructure
Element Group - An infrastructure element-group reference.
- Infrastructure
Inquiry Part - One infrastructure part returned by R49
ctiVysledekZjistiUzemiSpravcuDtiSeznamCastiDti. - Infrastructure
Manager Inquiry Request - Validated input for R49
zjistiUzemiSpravcuDti. - Infrastructure
Part Id - An opaque infrastructure-part identifier.
- Infrastructure
Part Info - Shared infrastructure-part identity, element group, and responsible roles used by R49.
- Infrastructure
Respondent Part - One infrastructure part and its respondent returned by R18a
ctiVyjadrovatele. - Input
File - Metadata for a caller-supplied supporting document.
- Inquiry
Cadastral Area - A RÚIAN cadastral area reference in an R49 overall result.
- Inquiry
Contact Details - Contact details supplied for obtaining a statement about one infrastructure part.
- Inquiry
Municipality - A RÚIAN municipality reference in an R49 overall result.
- Inquiry
Parcel - One RÚIAN parcel returned in an R49 overall result.
- Inquiry
Parcel Group - All parcels associated with one cadastral area in an R49 overall result.
- Inquiry
Submission Id - The opaque
IdPodanireturned in an R49 overall result. - Inquiry
Validation Result - Validation outcome attached to one infrastructure part in an R49 page.
- IsDmvs
Certificate - An IS DMVS authentication certificate returned by R24a
vylistujCertifikatyIsDmvs. - JvfVersion
- One complete JVF version returned by R24a
ctiVerziJvf. - JvfVersion
Info - Metadata for one documented JVF version.
- Legal
Person - A legal person or organization in the IS DMVS subject registry.
- NonPublic
Custom Area Dataset Request - Validated input for R19
vyhotovNeverejnouDatovouSadu. - Overall
Result - Overall data returned by R49
ctiVysledekZjistiUzemiSpravcuDti. - Page
- One DMVS offset page without hidden auto-pagination.
- Page
Request - Exact DMVS offset-page input.
- Physical
Person - A physical person in the IS DMVS subject registry.
- Public
Custom Area Dataset Request - Validated input for R19
vyhotovVerejnouDatovouSadu. - Region
Code - An IS DTMK region code, retained as a string.
- Request
Id - An opaque server-issued asynchronous request identifier.
- Response
- A successful DMVS value together with common response metadata.
- Response
Metadata - Common response correlation, state, and messages.
- Ruian
Address - A structured RÚIAN postal address.
- Service
Error - An application-level DMVS error containing the complete server message list.
- Service
Message - One informational, warning, error, or unknown DMVS service message.
- Subject
- A full registry subject, including optional direct contact details.
- Subject
Id - An opaque IS DMVS subject identifier.
- Subject
Info - Subject identity and person information without direct contact details.
- Submission
Recovery - A decoded asynchronous submission response that can be resumed by its durable request ID.
- TlsIdentity
- PEM certificate chain and private key used for DMVS mutual TLS.
- Wait
Options - Bounds and pacing for application-asynchronous DMVS result polling.
- XmlDate
- An XML calendar date retaining its validated lexical representation.
- XmlDate
Time - An XML date-time retaining its original lexical representation.
Enums§
- Address
- The address choice used by a registered person or organization.
- Area
Geometry - Public geometry variants accepted by DMVS area operations.
- Checksum
Algorithm - A checksum algorithm explicitly declared by a protocol value.
- Code
List Attribute Kind - The value representation of a code-list attribute.
- Code
List Data Type - A data type supported by a plain DMVS code-list attribute.
- Coordinate
Reference System - Coordinate reference system attached to a DMVS area.
- Dataset
Evidence Purpose - The required purpose choice in non-public supporting evidence.
- Dataset
Format - A dataset format, retaining values unknown to this crate version.
- Dataset
Outcome - Per-region issuance outcome, with raw preservation.
- Dataset
Region State - Processing state of one IS DTMK region, with raw preservation.
- Environment
- DMVS deployment to which a client sends requests.
- Error
- Errors produced while configuring or calling the DMVS client.
- Infrastructure
Manager Inquiry Selector - The explicit territorial choice for an R49 infrastructure-manager inquiry.
- Infrastructure
Subject Role - A subject role accepted by the approved R18b searches.
- Integrity
Status - Result of a requested integrity check.
- Message
Code - A common DMVS message code with raw preservation for future values.
- Message
Level - Severity of a DMVS service message.
- NonPublic
Dataset Content - Content accepted by non-public R19 custom-area dataset requests.
- NonPublic
Requester Status - Requester statuses supported by the selected non-public workflow.
- Person
- The physical/legal-person choice in an IS DMVS subject.
- Processing
State - Common processing state returned in every DMVS response header.
- Public
Custom Area Dataset Content - Content accepted by public R19 custom-area dataset requests.
- Wait
Backoff - Backoff strategy for bounded asynchronous-result waiting.
Type Aliases§
- Result
- Result alias used by the DMVS crate.