-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsimple-soap.html
199 lines (166 loc) · 7.39 KB
/
simple-soap.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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<script type="text/x-red" data-template-name="simple-soap">
<div class="form-row">
<label for="node-input-host"><i class="fa fa-globe"></i> Base URL</label>
<input type="text" id="node-input-host" style="width:70%;"/>
<input type="hidden" id="node-input-hostType">
</div>
<div class="form-row">
<label for="node-input-path"><i class="fa fa-folder-o"></i> Path</label>
<input type="text" id="node-input-path" style="width:70%;"/>
<input type="hidden" id="node-input-pathType">
</div>
<div class="form-row">
<label for="node-input-action"><i class="fa fa-cogs"></i> Action</label>
<input type="text" id="node-input-action" style="width:70%;"/>
<input type="hidden" id="node-input-actionType">
</div>
<div class="form-row">
<label for="node-input-body"><i class="fa fa-code"></i> Body</label>
<input type="text" id="node-input-body" style="width:70%;"/>
<input type="hidden" id="node-input-bodyType">
</div>
<div class="form-row">
<label></label>
<label for="node-input-mustache" style="width:70%">
<input type="checkbox" id="node-input-mustache" style="display:inline-block; width:22px; vertical-align:baseline;"> Body is mustache template
</label>
</div>
<div class="form-row">
<label><i class="fa fa-sliders"></i> Response</label>
Attribute prefix: <input type="text" id="node-input-attrkey" style="width:50px;" />
</div>
<div class="form-row">
<label></label>
Content prefix: <input type="text" id="node-input-charkey" style="width:50px;" />
</div>
<div class="form-row">
<label></label>
<label for="node-input-stripPrefix" style="width:70%">
<input type="checkbox" id="node-input-stripPrefix" style="display:inline-block; width:22px; vertical-align:baseline;"> Remove namespaces
</label>
</div>
<div class="form-row">
<label></label>
<label for="node-input-simplify" style="width:70%">
<input type="checkbox" id="node-input-simplify" style="display:inline-block; width:22px; vertical-align:baseline;"> Handle child nodes as arrays
</label>
</div>
<div class="form-row">
<label></label>
<label for="node-input-normalizeTags" style="width:70%">
<input type="checkbox" id="node-input-normalizeTags" style="display:inline-block; width:22px; vertical-align:baseline;"> Normalize all tag names to lowercase
</label>
</div>
<div class="form-row">
<label></label>
<label for="node-input-normalize" style="width:70%">
<input type="checkbox" id="node-input-normalize" style="display:inline-block; width:22px; vertical-align:baseline;"> Trim whitespaces inside text nodes
</label>
</div>
<div class="form-row">
<label for="node-input-useAuth"><i class="fa fa-lock"></i> Auth</label>
<input type="checkbox" id="node-input-useAuth" style="width: auto !important;">
<div style="margin-left: 125px" class="node-input-useAuth-row hide">
<div class="form-row">
<input type="text" id="node-input-user" placeholder="User">
</div>
<div class="form-row">
<input type="password" id="node-input-password" placeholder="Password">
</div>
</div>
</div>
<div class="form-row">
<label for="node-input-topic"><i class="fa fa-tags"></i> Topic</label>
<input type="text" id="node-input-topic" placeholder="" style="width: 70%;">
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="" style="width: 70%;">
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType('simple-soap', {
category: 'network',
color: '#cc66ff',
defaults: {
host: { value: "", required: true, validate: RED.validators.typedInput("hostType") },
hostType: { value: "str" },
path: { value: "/", required: false, validate: RED.validators.typedInput("pathType") },
pathType: { value: "str" },
action: { value: "", required: true, validate: RED.validators.typedInput("actionType") },
actionType: { value: "str" },
body: { value: "payload", required: true, validate: RED.validators.typedInput("bodyType") },
bodyType: { value: "msg" },
mustache: { value: false },
attrkey: { value: "$" },
charkey: { value: "_" },
stripPrefix: { value: false },
simplify: { value: false },
normalizeTags: { value: false },
normalize: { value: false },
topic: { value: "" },
name: { value: "" },
useAuth: { value: false }
},
credentials: {
user: { type: "text" },
password: {type: "password" }
},
inputs: 1,
outputs: 1,
icon: "white-globe.png",
label: function () {
return this.name || "SOAP";
},
oneditprepare: function () {
$("#node-input-useAuth").on("change", function() {
if ($(this).is(":checked")) {
$(".node-input-useAuth-row").show();
} else {
$(".node-input-useAuth-row").hide();
$('#node-input-user').val('');
$('#node-input-password').val('');
}
});
if (this.hostType == null || this.hostType === 'string' || this.hostType === 'none') {
this.hostType = "str";
}
$("#node-input-hostType").val(this.hostType);
$("#node-input-host").typedInput({
default: 'str',
typeField: $("#node-input-hostType"),
types: ['str', 'msg', 'flow', 'global', 'env']
});
if (this.pathType == null || this.pathType === 'string' || this.pathType === 'none') {
this.pathType = "str";
}
$("#node-input-pathType").val(this.pathType);
$("#node-input-path").typedInput({
default: 'str',
typeField: $("#node-input-pathType"),
types: ['str', 'msg', 'flow', 'global', 'env']
});
if (this.actionType == null || this.actionType === 'string' || this.actionType === 'none') {
this.actionType = "str";
}
$("#node-input-actionType").val(this.actionType);
$("#node-input-action").typedInput({
default: 'str',
typeField: $("#node-input-actionType"),
types: ['str', 'msg', 'flow', 'global', 'env']
});
if (this.bodyType == null || this.bodyType === 'string' || this.bodyType === 'none') {
this.bodyType = "msg";
}
if (this.body === undefined) {
$("#node-input-body").val("payload");
}
$("#node-input-bodyType").val(this.bodyType);
$("#node-input-body").typedInput({
default: 'msg',
typeField: $("#node-input-bodyType"),
types: ['str', 'msg', 'flow', 'global', 'env']
});
}
});
</script>