-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
116 lines (113 loc) · 5.9 KB
/
index.html
File metadata and controls
116 lines (113 loc) · 5.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<html>
<header>
<script type="text/javascript">
function createSubmission(){
var user = "manhnd";
var pass = "123456";
var xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
//Assign callback for request
xmlhttp.onreadystatechange = createSumission_callback;
xmlhttp.onerror = function(e) {
alert("Error ocurred. Error = " + e.message);
}
xmlhttp.ontimeout = function(e) {
alert("Timeout error!");
}
//Connect request to URL
xmlhttp.open('POST', 'http://ideone.com:80/api/1/service', true);
//xmlhttp.open('POST', 'http://localhost/index.php', true);
//Build HTTP request content
var sourceCode = document.getElementById('SourceCode').value;
var testreq =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>"+
"<SOAP-ENV:Envelope "+
"xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" "+
"xmlns:tns=\"http://ideone.com:80/api/1/service\" "+
"xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" "+
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "+
"xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" "+
"xmlns:soap-enc=\"http://schemas.xmlsoap.org/soap/encoding/\" "+
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" >"+
"<SOAP-ENV:Body>"+
"<mns:createSubmission "+
"xmlns:mns=\"http://ideone.com:80/api/1/service\" "+
"SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"+
"<user xsi:type=\"xsd:string\">" + user + "</user>"+
"<pass xsi:type=\"xsd:string\">" + pass + "</pass>"+
"<sourceCode xsi:type=\"xsd:string\">" + sourceCode + "</sourceCode>"+
"<language xsi:type=\"xsd:int\">29</language>"+
"<input xsi:type=\"xsd:string\"></input>"+
"<run xsi:type=\"xsd:boolean\">1</run>"+
"<private xsi:type=\"xsd:boolean\">1</private>"+
"</mns:createSubmission>"+
"</SOAP-ENV:Body>"+
"</SOAP-ENV:Envelope>";
// Send request
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
//xmlhttp.setRequestHeader('SOAPAction', 'http://ideone.com:80/api/1/service');
xmlhttp.send(testreq);
//alert(req);
}
function createSumission_callback(){
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
var link = xmlhttp.responseXML.getElementsByTagName("value")[1].childNodes[0].nodeValue;
getSubmissionDetails(link);
}
}
function getSubmissionDetails_callback(){
}
function getSubmissionDetails(link){
var xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange = getSubmissionDetails_callback;
xmlhttp.open('POST', 'http://ideone.com:80/api/1/service', true);
var getSubmissionDetailsRequest =
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>"+
"<SOAP-ENV:Envelope "+
"xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" "+
"xmlns:tns=\"http://ideone.com:80/api/1/service\" "+
"xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" "+
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "+
"xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" "+
"xmlns:soap-enc=\"http://schemas.xmlsoap.org/soap/encoding/\" "+
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" >"+
"<SOAP-ENV:Body>"+
"<mns:getSubmissionDetails "+
"xmlns:mns=\"http://ideone.com:80/api/1/service\" "+
"SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"+
"<user xsi:type=\"xsd:string\">manhnd</user>"+
"<pass xsi:type=\"xsd:string\">123456</pass>"+
"<link xsi:type=\"xsd:string\">" + link + "</link>"+
"<withSource xsi:type=\"xsd:boolean\">1</withSource>"+
"<withInput xsi:type=\"xsd:boolean\">1</withInput>"+
"<withOutput xsi:type=\"xsd:boolean\">1</withOutput>"+
"<withStderr xsi:type=\"xsd:boolean\">1</withStderr>"+
"<withCmpinfo xsi:type=\"xsd:boolean\">1</withCmpinfo>"+
"</mns:getSubmissionDetails>"+
"</SOAP-ENV:Body>"+
"</SOAP-ENV:Envelope>";
}
/*
var req = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope " +
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
"<soap:Body xmlns:mns=\"http://ideone.com:80/api/1/service\">" +
"<mns:createSubmission>" +
"<user>manhnd</user>" +
"<pass>123456</pass>" +
"<soureCode>" + sourceCode + "</soureCode>" +
"<language>29</language>" +
"<input></input>" +
"<run>1</run>" +
"<privte>1</private>" +
"</mns:createSubmission></soap:Body></soap:Envelope>";
*/
</script>
</header>
<body>
<button name="test" onclick="createSubmission(); return false;">See result</button>
<textarea id="SourceCode" name="SourceCode"></textarea>
<div id="result">Result</div>
</body>
</html>