pub struct SoapConfig {
pub version: SoapVersion,
pub action: Option<String>,
pub body_inner: Option<String>,
pub namespaces: HashMap<String, String>,
pub path_relative_to_body: bool,
pub fault_as_error: bool,
}Expand description
First-class SOAP ergonomics for the XML source.
This is sugar over the existing XML-over-HTTP request/response path —
not a WSDL client. When present, the source assembles a SOAP envelope for
the request body, injects the version-appropriate headers, and (by default)
resolves XmlStreamConfig::records_element_path relative to
Envelope.Body and surfaces SOAP <Fault> responses as errors.
Fields§
§version: SoapVersionSOAP protocol version (default 1.1).
action: Option<String>The SOAP action. For 1.1 it becomes the SOAPAction header; for 1.2 it
is carried as the action parameter of the Content-Type header.
Optional — omit for actionless operations.
body_inner: Option<String>The XML fragment placed inside <soap:Body> — typically the operation
element, e.g. <GetUsers xmlns="urn:example"/>. Mutually exclusive with
the top-level XmlStreamConfig::body.
namespaces: HashMap<String, String>Extra namespace declarations (prefix → URI) added to the envelope
element. The soap prefix is reserved for the envelope namespace and
any entry using it is ignored.
path_relative_to_body: boolWhen true (default), XmlStreamConfig::records_element_path is
resolved relative to Envelope.Body — i.e. Envelope.Body. is
auto-prepended, so you write GetUsersResponse.Users.User. Set false
to supply the fully-qualified path from the document root.
fault_as_error: boolWhen true (default), a SOAP <Fault> in the response raises
FaucetError::Source. When false,
a fault yields zero records (logged once).
Implementations§
Source§impl SoapConfig
impl SoapConfig
Sourcepub fn build_envelope(&self, body_inner: &str) -> String
pub fn build_envelope(&self, body_inner: &str) -> String
Assemble the SOAP request envelope wrapping body_inner inside
<soap:Body>, declaring the version namespace plus any user-declared
prefixes on the envelope element.
Prefixes are emitted in a deterministic (sorted) order so the assembled body is stable across runs.
Sourcepub fn content_type(&self) -> String
pub fn content_type(&self) -> String
The Content-Type header value for a request of this SOAP version.
For 1.2 the action (when set) is carried as a Content-Type parameter.
Sourcepub fn soap_action_header(&self) -> Option<String>
pub fn soap_action_header(&self) -> Option<String>
The SOAPAction header value (quoted) for SOAP 1.1. Always None for
SOAP 1.2, which carries the action inside Content-Type instead.
Trait Implementations§
Source§impl Clone for SoapConfig
impl Clone for SoapConfig
Source§fn clone(&self) -> SoapConfig
fn clone(&self) -> SoapConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SoapConfig
impl Debug for SoapConfig
Source§impl Default for SoapConfig
impl Default for SoapConfig
Source§impl<'de> Deserialize<'de> for SoapConfig
impl<'de> Deserialize<'de> for SoapConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SoapConfig
impl JsonSchema for SoapConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more