use std::time::Duration;
use crate::net::transport::Transport;
use crate::Result;
const SOAP_ACTION_BASE: &str = "http://arx.com/SAPIWS/DSS/1.0/";
pub fn send_soap(
transport: &Transport,
url: &str,
envelope: &str,
action: &str,
timeout: Duration,
max_retries: u32,
) -> Result<String> {
let soap_action = format!("{SOAP_ACTION_BASE}{action}");
let headers = [
("Content-Type", "text/xml; charset=utf-8"),
("SOAPAction", soap_action.as_str()),
];
let response = transport.post(url, envelope.as_bytes(), &headers, timeout, max_retries)?;
Ok(String::from_utf8_lossy(&response).into_owned())
}