Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.open('POST','http://domain:8000/sap/bc/soap/rfc/test_ws/100/test_ws/zbwf_test_ws', 'user', 'pass');
- var sr =
- '<?xml version="1.0" encoding="utf-8"?>' +
- '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">'+
- '<soapenv:Header/>' +
- '<soapenv:Body>' +
- '<urn:function1>' +
- '<param1>14021409094682</param1>' +
- '</urn:function1>' +
- '</soapenv:Body>' +
- '</soapenv:Envelope>';
- xmlhttp.onreadystatechange = function(){
- console.log(xmlhttp.responseText);
- }
- xmlhttp.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
- /* Test to overcome SOP
- xmlhttp.setRequestHeader("Authorization", "Basic " + btoa('user' + ":" + 'admin'));
- xmlhttp.setRequestHeader("Access-Control-Allow-Origin", "*");
- xmlhttp.setRequestHeader("Access-Control-Allow-Credentials", "true");
- xmlhttp.setRequestHeader("Access-Control-Allow-Methods", "OPTIONS, GET, POST");
- xmlhttp.setRequestHeader("Access-Control-Allow-Headers", "Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control")
- */
- var result = xmlhttp.send(sr);
- console.log(result);
- </script>
- </head>
- <body></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement