Crates.io | wsdl |
lib.rs | wsdl |
version | 0.1.3 |
source | src |
created_at | 2021-09-26 22:51:36.154107 |
updated_at | 2023-07-29 19:32:02.801332 |
description | Idiomatic Rust wrapper for WSDL |
homepage | https://github.com/DrChat/wsdl-rs |
repository | https://github.com/DrChat/wsdl-rs |
max_upload_size | |
id | 456706 |
size | 404,613 |
This library simply wraps a WSDL XML file with an idiomatic Rust interface.
The underlying XML library is roxmltree
, on top of which this library declares
Rust newtypes to expose a native interface for reading WSDL files.
# use anyhow::Result;
use wsdl::Wsdl;
fn example() -> Result<()> {
let input = std::fs::read_to_string("/path/to/my/service.wsdl")?;
let document = roxmltree::Document::parse(&input)?;
let wsdl = WsDefinitions::from_document(&document)?;
for service in wsdl.services()? {
println!("Service: {}", service.name()?);
}
for binding in wsdl.bindings()? {
println!(
"Binding: {} -> {}",
binding.name()?,
binding.port_type()?.name()?
);
}
Ok(())
}
See the traversal script for a complete (and usable) example. Run it with:
cargo run --example traverse ./path/to/my/service.wsdl
Errors generated by this library can be traced directly to the originating XML node. The originating node ID is embedded in the first parameter of [WsError].