All Projects → lumeohq → xsd-parser-rs

lumeohq / xsd-parser-rs

Licence: other
A xsd/wsdl => rust code generator written in rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to xsd-parser-rs

xsdata
Naive XML & JSON Bindings for python
Stars: ✭ 144 (+220%)
Mutual labels:  soap, wsdl, xsd
cxf-spring-boot-starter
Enterprise & production ready SOAP webservices powered by Spring Boot & Apache CXF
Stars: ✭ 129 (+186.67%)
Mutual labels:  soap, wsdl
wsdl-tsclient
📄 Generate typescript client from wsdl
Stars: ✭ 30 (-33.33%)
Mutual labels:  soap, wsdl
Python Zeep
A modern/fast python SOAP client based on lxml / requests
Stars: ✭ 1,638 (+3540%)
Mutual labels:  soap, wsdl
soap-spring-boot-cxf
Sample Project for producing & testing a SOAP-WSDL-driven Service with Spring Boot, Apache CXF & JAX-WS
Stars: ✭ 56 (+24.44%)
Mutual labels:  soap, wsdl
wsdl-to-ts
Generate TypeScript typings for WSDL services
Stars: ✭ 60 (+33.33%)
Mutual labels:  soap, wsdl
PackageBase
Contains base classes from which the generated classes from PackageGenerator inherit
Stars: ✭ 19 (-57.78%)
Mutual labels:  soap, wsdl
jgeXml
The Just-Good-Enough XML Toolkit
Stars: ✭ 20 (-55.56%)
Mutual labels:  xsd
jsons2xsd
Highly configurable converter from JSON-schema to XML-schema (XSD).
Stars: ✭ 65 (+44.44%)
Mutual labels:  xsd
libONVIF
Yet another ONVIF library
Stars: ✭ 96 (+113.33%)
Mutual labels:  onvif
onvif-django-client
Django(Python) app to connect to onvif cameras (onvif django client)
Stars: ✭ 66 (+46.67%)
Mutual labels:  onvif
soap-typescript
SOAP decorators for creating wsdl's and annotating services to provide metadata for node-soap
Stars: ✭ 20 (-55.56%)
Mutual labels:  soap
LinqToXsdCore
LinqToXsd ported to .NET Core (targets .NET Standard 2 for generated code and .NET Core 3.1, .NET 5+ 6 for the code generator CLI tool).
Stars: ✭ 23 (-48.89%)
Mutual labels:  xsd
WSD-python
Web Services for Devices (WSD) tools and utilities for cross platform support
Stars: ✭ 22 (-51.11%)
Mutual labels:  soap
ballerina-integrator
A powerful, simple-to-learn, code-driven approach to programming integrations
Stars: ✭ 36 (-20%)
Mutual labels:  soap
v4l2onvif
ONVIF server for V4L2 Devices
Stars: ✭ 83 (+84.44%)
Mutual labels:  onvif
wsdd
wsdd is Linux daemon for ONVIF WS-Discovery service (server side)
Stars: ✭ 41 (-8.89%)
Mutual labels:  onvif
extensiveautomation-server
Extensive Automation server
Stars: ✭ 19 (-57.78%)
Mutual labels:  soap
remote-virtualbox
🍰 Little package to do simple things with VirtualBox remotely using it's SOAP API
Stars: ✭ 18 (-60%)
Mutual labels:  soap
php-amadeus
Amadeus flight booking client for PHP
Stars: ✭ 65 (+44.44%)
Mutual labels:  soap

xsd-parser-rs

An xsd/wsdl => rust code generator written in rust. The main target is for generation of the ONVIF Specifications but should work for other SOAP/XSDL/WSDL needs.

Work in Progress

This is still a work in progress. So please feel free to open issues and submit PRs. Please be sure to read and follow our Code of Conduct.

XSD types mapping

A following mapping used to represent built-in XSD types as rust types:

XSD rust
hexBinary String
base64Binary String
boolean bool
integer Integer (1)
nonNegativeInteger NonNegativeInteger (1)
positiveInteger PositiveInteger (1)
nonPositiveInteger NonPositiveInteger (1)
negativeInteger NegativeInteger (1)
long i64
int i32
short i16
byte i8
unsignedLong u64
unsignedInt u32
unsignedShort u16
unsignedByte u8
decimal Decimal (2)
double f64
float f64
date Date (3)
time Time (3)
dateTime DateTime (3)
dateTimeStamp DateTimeStamp (3)
duration Duration (4)
gDay GDay (5)
gMonth GMonth (5)
gMonthDay GMonthDay (5)
gYear GYear (5)
gYearMonth GYearMonth (5)
string String
normalizedString String
token String
language String
Name String
NCName String
ENTITY String
ID String
IDREF String
NMTOKEN String
anyURI String
QName String
NOTATION String
ENTITIES Vec<String>
IDREFS Vec<String>
NMTOKENS Vec<String>

Notes:

(1) we are using our own big integer types, that wrap num_bigint::BigInt and num_bigint::BigUint and provide XML (de)serialization with yaserde. You can find Integer, NonNegativeInteger, PositiveInteger, NonPositiveInteger and NegativeInteger in the corresponding files within xsd-types/src/types/

(2) we are using our own type Decimal, which wraps bigdecimal::BigDecimal and provides XML (de)serialization with yaserde. You can find Decimal in xsd-types/src/types/decimal.rs

(3) we are using our own time types, that wrap types from chrono crate and provide XML (de)serialization with yaserde. You can find Date, Time, DateTime and DateTimeStamp in the corresponding files within xsd-types/src/types/. Since chrono has it flaws and does not follow ISO 8601 strictly, we use self-implemented parsing and might replace chrono in the future. Feel free to suggest an appropriate crate for time handling.

(4) we are using our own type Duration, since there is no known implementation in rust that supports proper month/years holding and literal representation. You can find Duration in xsd-types/src/types/duration.rs

(5) we are using our own gregorian calendar types, that provide XML (de)serialization with yaserde following ISO 8601 strictly. You can find gDay, gMonth, gMonthDay, gYear and gYearMonth in the corresponding files within xsd-types/src/types/.

any elements handling

There are cases when schema allows extensions for the certain type.

<xs:complexType name="MyType">
    <xs:sequence>
        <xs:element name="Parameters" type="xs:string" />
        <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:anyAttribute namespace="##any" processContents="lax"/>
</xs:complexType>

In such cases we don't know in advance what fields must be present in Rust struct so we don't add them to output:

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde(prefix = "tns", namespace = "tns: http://example.com")]
pub struct MyType {
    #[yaserde(prefix = "tns", rename = "Parameters")]
    pub parameters: String,
}

In this unlucky situation to support extensions user can either:

  • modify the generated code and add extension fields manually
  • modify source XSD and add extension elements there

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].