-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDESTraining.html
82 lines (62 loc) · 2.21 KB
/
DESTraining.html
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
<html>
<head>
<title>DES Demo</title>
<script src="http://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
</head>
<body>
<h1>DES Demo</h1>
<h2>Greetings</h2>
<fieldset>
<div>GET https://.../EPS/exchangepointservice.svc/des/hello?myname={value}</div>
<br />
<div>
<label for="caseinput">Case Lookup</label>
<input name="caseinput" id="caseinput" type="text" />
<input type="button" id="validateInput" value="Validate">
</div>
<hr>
<div>
Name: <div id="formatedCaseNumber" style="display:inline;"></div>
</div>
<div>
Casse ID: <div id="caseID" style="display:inline;"></div>
</div>
<br>
</fieldset>
<br>
<fieldset id="details">
</fieldset>
<script>
$(document).ready(function(){
});
var _caseID = 0;
$('#validateInput').click(function(){
var caseInput = $('#caseinput').val();
var desurl = 'http://showcase.equivant.com/eps/exchangepointservice.svc/des/hello?myname=' + caseInput;
$.ajax({
url: desurl,
dataType: "xml"
}).done(function(d){
console.log(d);
if (d){
var xmlobj = $(d);
if (xmlobj.find('Error').text()){
alert('oops! I got a boo boo :-(');
formatedCaseNumber = '';
caseID = '';
details = '';
$('#details').text(xmlobj.find('Error').text());
}
var formatedCaseNumber = xmlobj.find('casenumber').text();
var caseID = xmlobj.find('caseid').text();
var details = xmlobj.find('details')[0];
$('#formatedCaseNumber').text(formatedCaseNumber);
$('#caseID').text(caseID);
if (details)
$('#details').text((new XMLSerializer()).serializeToString(details));
}
});
});
</script>
</body>
</html>