JSFiddle - React, Tailwind, and code Playground

by budyniowski

HTML

<form name="Demo" action="" method="post">
        <div>
            <input type="button" value="Soap" onclick="soap()" />
        </div>
    </form>

JavaScript

function soap(){
            var xmlhttp = new XMLHttpRequest();
            xmlhttp.open('POST', 'http://192.168.1.2/mantisbt/api/soap/mantisconnect.php', true);

            // build SOAP request
            var sr =
                '<?xml version="1.0" encoding="utf-8"?>' +
                '<soapenv:Envelope ' + 
                    'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
					'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' + 
					'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' + 
					'xmlns:man="http://futureware.biz/mantisconnect" ' +
					  '<man:mc_projects_get_user_accessible soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' +
						 '<username xsi:type="xsd:string">Daniel.Budzynski</username>' +
						 '<password xsi:type="xsd:string">budyn1337</password>' +
					  '</man:mc_projects_get_user_accessible>' +
                    '</soapenv:Body>' +
                '</soapenv:Envelope>';

            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4) {
                    if (xmlhttp.status == 200) {
                        alert('done. use firebug/console to see network response');
                    }
                }
            }
            // Send the POST request
            xmlhttp.setRequestHeader('Content-Type', 'text/xml');
            xmlhttp.send(sr);
            // send request
            // ...
console.log('btn working')
}