Crate wsdl

Source
Expand description

§WSDL Rust XML bindings

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.

§Usage

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

§Error reporting

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.

§Non-goals

  • Parse the XSD-defined WSDL types. The XML specification is nebulous, and it would be best left to a separate crate that can also generate Rust bindings.

Re-exports§

pub use roxmltree;

Structs§

WsBinding
A WSDL binding that describes how the operations in a port type are bound to/from the wire.
WsDefinitions
WsError
WsMessage
Describes a WSDL message. These can otherwise be described as a list of function parameters.
WsMessagePart
Describes a part of a WSDL message. This can otherwise be described as an individual function parameter.
WsPortOperation
Describes an operation associated with a WSDL portType. A WSDL operation can otherwise be described as a function.
WsPortType
Describes a WSDL portType. These describe groups of operations.
WsService
A WSDL service, usually describing an HTTP endpoint that serves messages bound with a WsBinding
WsServicePort
WsTypes