pub struct SoapClient { /* private fields */ }Expand description
HTTP transport client for the Yuki SOAP API.
Implementations§
Source§impl SoapClient
impl SoapClient
pub fn new(base_url: &str) -> Self
pub fn with_session(self, session_id: &str) -> Self
pub fn session_id(&self) -> Option<&str>
Sourcepub fn soap_action(_service: &str, operation: &str) -> String
pub fn soap_action(_service: &str, operation: &str) -> String
Build the SOAPAction header value for a given operation.
Sourcepub async fn call(
&self,
operation: &str,
envelope: String,
) -> Result<String, YukiError>
pub async fn call( &self, operation: &str, envelope: String, ) -> Result<String, YukiError>
POST a SOAP envelope and return the raw response body.
Sourcepub async fn authenticate(&mut self, api_key: &str) -> Result<String, YukiError>
pub async fn authenticate(&mut self, api_key: &str) -> Result<String, YukiError>
Authenticate with an API key, storing the returned session ID.
Sourcepub fn parse_single_result(
xml: &str,
result_tag: &str,
) -> Result<String, YukiError>
pub fn parse_single_result( xml: &str, result_tag: &str, ) -> Result<String, YukiError>
Extract the text content of a single named element from a SOAP response.
Returns an error if a SOAP fault is found or the element is missing.
Sourcepub fn parse_soap_fault(xml: &str) -> Option<YukiError>
pub fn parse_soap_fault(xml: &str) -> Option<YukiError>
Detect a SOAP fault in the response and return it as a YukiError.
Returns None if no fault is present.
Auto Trait Implementations§
impl Freeze for SoapClient
impl !RefUnwindSafe for SoapClient
impl Send for SoapClient
impl Sync for SoapClient
impl Unpin for SoapClient
impl UnsafeUnpin for SoapClient
impl !UnwindSafe for SoapClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more