pub async fn soap_action(client : &Client, url: &str, action: &str, xml: &str) -> Result<Response> {
    let soap_action = HeaderName::from_bytes(b"SOAPAction").unwrap();
    let soap_value = HeaderValue::from_str(action).unwrap();
    let mut hmap = HeaderMap::new();
    hmap.insert(CONTENT_TYPE, "text/xml; charset=utf-8".parse().unwrap());
    hmap.insert(soap_action, soap_value);

    let response = client
        .post(url)
        .headers(hmap)
        .body(xml.to_string())
        .send()
        .await?;

    if response.status() != 200 {
        return Err(HttpError::InvalidStatusCode(response.status()));
    }
    let status = response.status();
    let body = response.text().await?;

    Ok(Response { status, body })
}
/// Perform a SOAP action to specified URL.
Perform a SOAP action to specified URL.
Perform a SOAP action to specified URL .
pub async fn soap_action(client : &Client, url: &str, action: &str, xml: &str) -> Result<Response> {
    let soap_action = HeaderName::from_bytes(b"SOAPAction").unwrap();
    let soap_value = HeaderValue::from_str(action).unwrap();
    let mut hmap = HeaderMap::new();
    hmap.insert(CONTENT_TYPE, "text/xml; charset=utf-8".parse().unwrap());
    hmap.insert(soap_action, soap_value);
    let response = client
        .post(url)
        .headers(hmap)
        .body(xml.to_string())
        .send()
        .await?;
    if response.status() != 200 {
        return Err(HttpError::InvalidStatusCode(response.status()));
    }
    let status = response.status();
    let body = response.text().await?;
    Ok(Response { status, body })
}
pub async fn soap_action ( client : & Client , url : & str , action : & str , xml : & str ) -> Result < Response > { let soap_action = HeaderName :: from_bytes ( b" " ) . unwrap ( ) ; let soap_value = HeaderValue :: from_str ( action ) . unwrap ( ) ; let mut hmap = HeaderMap :: new ( ) ; hmap . insert ( CONTENT_TYPE , " " . parse ( ) . unwrap ( ) ) ; hmap . insert ( soap_action , soap_value ) ; let response = client . post ( url ) . headers ( hmap ) . body ( xml . to_string ( ) ) . send ( ) . await ? ; if response . status ( ) != 200 { return Err ( HttpError :: InvalidStatusCode ( response . status ( ) ) ) ; } let status = response . status ( ) ; let body = response . text ( ) . await ? ; Ok ( Response { status , body } ) }
Perform a SOAP action to specified URL.
Perform a SOAP action to specified URL .
client
&Client
url
&str
action
&str
xml
&str