1
|
# Analyse - envoi Maarch Courrier vers dépôt MultiGest - ticket 14837
|
2
|
(Quentin RIBAC, 23 septembre 2021)
|
3
|
|
4
|
## TODO
|
5
|
- trouver comment lister les sas / armoires MultiGest
|
6
|
- demander la doc pour `GedDocumentAddAttachment`
|
7
|
- vérifier la conservation du mode UID après envoi de la requête `GedSetModeUid(state = 1)`
|
8
|
- si non conservation etre deux requêtes, voir comment faire plusieurs requêtes à la fois pour forcer UID=1 et la requête cible
|
9
|
|
10
|
## Généralités sur les requêtes
|
11
|
- méthode POST
|
12
|
- point d’accès
|
13
|
- `https://mon-srv.multigest.com/Interconnexion/SOAP/SoapServer.php?className=APIMultigest&style=rpc&styletype=encoded`
|
14
|
- authentification BASIC
|
15
|
|
16
|
## Requêtes MultiGest utiles
|
17
|
Requête | Rôle | Note
|
18
|
--------------------------|-----------------------------------------|---------
|
19
|
GedSetModeUid | Basculer le mode UID | 0/1 -> désactivé/activé
|
20
|
GedImporterDocumentStream | Dépôt d’un document | FileSourceStream (base64), ModeDiffere à -1 pour import immédiat, renvoie l’idDoc ou code erreur
|
21
|
GedDocumentMdatasUpdate | Écriture des métasdonnées d’un document | Attention : `|` comme séparateur de valeurs
|
22
|
GedDocumentAddAttachment | Ajout de PJ à un document | Manque la documentation des paramètres de la requête
|
23
|
??? | Liste des sas / armoires MultiGest | Aucune requête correspondante dans la doc ni dans le WSDL
|
24
|
GedSetModeUid | Test de connexion | envoyer `state = 1` ; OK/KO sur statut HTTP 200/autre
|
25
|
|
26
|
## Exemple – requête `GedSetModeUid`
|
27
|
```http
|
28
|
POST https://mon-srv.multigest.com/Interconnexion/SOAP/SoapServer.php?className=APIMultigest&style=rpc&styletype=encoded
|
29
|
Accept-Encoding: gzip,deflate
|
30
|
Content-Type: text/xml;charset=UTF-8
|
31
|
SOAPAction: "urn:GedSetModeUid"
|
32
|
|
33
|
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:APIMultigest">
|
34
|
<soapenv:Header/>
|
35
|
<soapenv:Body>
|
36
|
<urn:GedSetModeUid soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
37
|
<state xsi:type="xsd:int">0</state>
|
38
|
</urn:GedSetModeUid>
|
39
|
</soapenv:Body>
|
40
|
</soapenv:Envelope>
|
41
|
```
|
42
|
|
43
|
Réponse si succès
|
44
|
```http
|
45
|
HTTP/1.1 200 OK
|
46
|
Date: Thu, 23 Sep 2021 15:46:01 GMT
|
47
|
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/7.4.13
|
48
|
X-Frame-Options: SAMEORIGIN
|
49
|
Strict-Transport-Security: max-age=500; includeSubDomains; preload
|
50
|
Vary: Referer,Accept-Encoding
|
51
|
X-Powered-By: PHP/7.4.13
|
52
|
Set-Cookie: mtgweb=le-cookie; path=/; HttpOnly; SameSite=1
|
53
|
Expires: Thu, 19 Nov 1981 08:52:00 GMT
|
54
|
Cache-Control: no-store, no-cache, must-revalidate
|
55
|
Pragma: no-cache
|
56
|
Content-Encoding: gzip
|
57
|
Content-Length: 225
|
58
|
Keep-Alive: timeout=10, max=500
|
59
|
Connection: Keep-Alive
|
60
|
Content-Type: text/xml; charset=utf-8
|
61
|
|
62
|
<?xml version="1.0" encoding="UTF-8"?>
|
63
|
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:APIMultigest" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
64
|
<SOAP-ENV:Body>
|
65
|
<ns1:GedSetModeUidResponse/>
|
66
|
</SOAP-ENV:Body>
|
67
|
</SOAP-ENV:Envelope>
|
68
|
```
|
69
|
|
70
|
Réponse si erreur – dans ce cas, en mettant autre chose qu’un nombre dans le `<state>` de la requête plus haut.
|
71
|
```http
|
72
|
HTTP/1.1 500 Internal Server Error
|
73
|
Date: Thu, 23 Sep 2021 15:48:59 GMT
|
74
|
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/7.4.13
|
75
|
X-Frame-Options: SAMEORIGIN
|
76
|
Strict-Transport-Security: max-age=500; includeSubDomains; preload
|
77
|
Vary: Referer
|
78
|
X-Powered-By: PHP/7.4.13
|
79
|
Set-Cookie: mtgweb=le-cookie; path=/; HttpOnly; SameSite=1
|
80
|
Expires: Thu, 19 Nov 1981 08:52:00 GMT
|
81
|
Cache-Control: no-store, no-cache, must-revalidate
|
82
|
Pragma: no-cache
|
83
|
Content-Length: 316
|
84
|
Connection: close
|
85
|
Content-Type: text/xml; charset=utf-8
|
86
|
|
87
|
<?xml version="1.0" encoding="UTF-8"?>
|
88
|
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
|
89
|
<SOAP-ENV:Body>
|
90
|
<SOAP-ENV:Fault>
|
91
|
<faultcode>SOAP-ENV:Server</faultcode>
|
92
|
<faultstring>SOAP-ERROR: Encoding: Violation of encoding rules</faultstring>
|
93
|
</SOAP-ENV:Fault>
|
94
|
</SOAP-ENV:Body>
|
95
|
</SOAP-ENV:Envelope>
|
96
|
```
|