-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-request.js
47 lines (44 loc) · 2.21 KB
/
generate-request.js
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
const { ISI: { USERNAME, PASSWORD } } = require('../config')
const documentsRequest = (uuid, counter, docCount, county) => {
return `<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://rim2.ist.com/rim2/v1/service" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<o:Security soap:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><o:UsernameToken u:Id="uuid-${uuid}-${counter}"><o:Username>${USERNAME}</o:Username><o:Password>${PASSWORD}</o:Password></o:UsernameToken></o:Security>
</soap:Header>
<soap:Body>
<ser:HentDataForArkivering>
<!--Optional:-->
<HentDataForArkiveringRequestElm>
<AntallElevDokument>${docCount}</AntallElevDokument>
<Fylke>${county}</Fylke>
</HentDataForArkiveringRequestElm>
</ser:HentDataForArkivering>
</soap:Body>
</soap:Envelope>`
}
const statusRequest = (uuid, counter, docId, ssn) => {
return `<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://rim2.ist.com/rim2/v1/service" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<o:Security soap:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><o:UsernameToken u:Id="uuid-${uuid}-${counter}"><o:Username>${USERNAME}</o:Username><o:Password>${PASSWORD}</o:Password></o:UsernameToken></o:Security>
</soap:Header>
<soap:Body>
<ser:LagreStatusArkiverteData>
<!--Optional:-->
<LagreStatusArkiverteDataRequestElm>
<Fagsystemnavn>${uuid}</Fagsystemnavn>
<DokumentId>${docId}</DokumentId>
<Fodselsnummer>${ssn}</Fodselsnummer>
<ArkiveringUtfort>true</ArkiveringUtfort>
<Feilmelding>
<FeilId></FeilId>
<Feiltype></Feiltype>
<DetaljertBeskrivelse></DetaljertBeskrivelse>
</Feilmelding>
</LagreStatusArkiverteDataRequestElm>
</ser:LagreStatusArkiverteData>
</soap:Body>
</soap:Envelope>`
}
module.exports = {
documentsRequest,
statusRequest
}