JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
973 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Is it possible to connect to a SOAP webservice using the Javascript window in Excel?
Based on javascript soap examples I've found I have tried the following without luck.
I'm not familiar with javascript yet so I don't know if it's possible or I just have an error in my code.
function main(workbook: ExcelScript.Workbook) {
var objXMLHttpRequest = new XMLHttpRequest();
objXMLHttpRequest.open("GET", "http://MXL:7101/MXL/MXLService?wsdl", true);
objXMLHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
var packet = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mxl="http://mxl.com/"> < soapenv: Header/>< soapenv: Body > <mxl: Version /> </soapenv:Body></soapenv:Envelope>';
objXMLHttpRequest.send(packet);
let response = objXMLHttpRequest.responseText;
console.log(response);
}