Adobe Campaign - Javascript SOAP Client

The function below can be used to call a SOAP endpoint from an Adobe Campaign workflow. Simply create use it within a Javascript step.

//params:
//method - HTTP method.  'POST' should be used by default.
//url - web address of SOAP endpoint
//body - SOAP envelope/body

function executeSOAPRequest(method, url, body) {
    var request = new HttpClientRequest(url);
    request.header["Content-Type"] = "text/xml; charset=utf-8";
    request.header["SOAPAction"] = method;
    request.method = method;
    request.body = body;

    request.execute();

    return request.response;
}