Fix spelling
[libisds.git] / doc / document_conversion
blobd147108734e74b080774ba5f697b6feb25a19d7a
1 Document conversion
2 ===================
4 Source: Reverse engineering of 602XML Filler, version 3.14
5 Source: Autorizovaná konverze z moci úřední – API
6     <http://www.mvcr.cz/clanek/autorizovana-konverze-z-moci-uredni.aspx>
9 Digital documents can be converted into their analogue projections. Currently 
10 only PDF 1.3 or higher document with digital signature is allowed to be
11 converted.
13 User can send such document through Internet into `Czech POINT' system, which
14 is responsible for so called authorized conversion.
16 Other direction from analogue form to digital one is possible too. Of course
17 software can obtain digital output only.
19 Public conversion interface is web page <https://www.czechpoint.cz/uschovna/>.
20 There is nice interactive interface with ugly CAPTCHA.
22 Proprietary client `602XML Filler' uses similar interface that works
23 automatically. Without CAPTCHA solving obviously. Description of this batch
24 interface follows.
27 Digital to Analogue Direction
28 =============================
30 Protocol: SOAP
31 URL: https://www.czechpoint.cz/uschovna/services.php
33 Input for XSLT is document subtree (rooted in p:dmFile) of ISDS message
34 Request XSLT:
35 <xsl:stylesheet xmlns:p="http://isds.czechpoint.cz/v20"
36         xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
37         xmlns:xsi="http://www.w3.org/2001/XMLS chema-instance"
38         xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
39         exclude-result-prefixes="p">
40     <xsl:output encoding="UTF-8" method="xml"/>
41     <xsl:template match="/">
42         <soapenv:Envelope xmlns:ns0="urn:uschovnaWSDL"
43                 xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
44                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
45                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
46             <soapenv:Body>
47                 <ns0:saveDocument>
48                     <conversionID soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
49                             xsi:type="xsd:string">0</conversionID>
50                     <fileName soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
51                             xsi:type="xsd:string">
52                         <xsl:value-of select="/p:dmFile/@dmFileDescr"/>
53                     </fileName>
54                     <document soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
55                             xsi:type="xsd:base64Binary">
56                         <xsl:value-of select="/p:dmFile/p:dmEncodedContent"/>
57                     </document>
58                 </ns0:saveDocument>
59             </soapenv:Body>
60         </soapenv:Envelope>
61     </xsl:template>
62 </xsl:stylesheet>
65 Response returns token. Converting officer uses the token to pick up a document
66 from Czech POINT input storage. Otherwise document expires after 30 days.
68 According 602XML Filler: Response is standard SOAP Fault error message or
69 undocumented structure in case of success
71 According real test:
73 In case of failure:
75 <SOAP-ENV:Envelope
76         xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
77         xmlns:ns1="urn:uschovnaWSDL"
78         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
79         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
80         xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
81         SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
82     <SOAP-ENV:Body>
83         <ns1:saveDocumentResponse>
84             <return xsi:type="ns1:DocumentSaveResponse">
85                 <status xsi:type="xsd:int">4</status>
86                 <statusMsg xsi:type="xsd:string">Neni dokument typu PDF |-1</statusMsg>
87                 <documentID xsi:nil="true"/>
88                 <dateInserted xsi:type="xsd:date">2010-02-11</dateInserted>
89             </return>
90         </ns1:saveDocumentResponse>
91     </SOAP-ENV:Body>
92 </SOAP-ENV:Envelope>
94 In case of success:
96 <SOAP-ENV:Envelope
97         xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
98         xmlns:ns1="urn:uschovnaWSDL"
99         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
100         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
101         xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
102         SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
103     <SOAP-ENV:Body>
104         <ns1:saveDocumentResponse>
105             <return xsi:type="ns1:DocumentSaveResponse">
106                 <status xsi:type="xsd:int">0</status>
107                 <statusMsg xsi:type="xsd:string">OK 1</statusMsg>
108                 <documentID xsi:type="xsd:string">816236355942291944571</documentID>
109                 <dateInserted xsi:type="xsd:date">2010-02-12</dateInserted>
110             </return>
111         </ns1:saveDocumentResponse>
112     </SOAP-ENV:Body>
113 </SOAP-ENV:Envelope>
115 As you can see the token is returned in
116 //ns1:saveDocumentResponse/return/documentID/text().
119 Analogue to Digital Direction
120 =============================
122 Officer stores digital document into output storage and provides a token to the user. User has 3 days to download the document.