Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 90ae3b9b48843a9436a31194d807fbc7 > files > 51

libisds-devel-0.3.1-1.fc14.x86_64.rpm

Document conversion
===================

Source: Reverse engineering of 602XML Filler, version 3.14
Source: Autorizovaná konverze z moci úřední – API
    <http://www.mvcr.cz/clanek/autorizovana-konverze-z-moci-uredni.aspx>


Digital documents can be converted into their analogue projections. Currently 
only PDF 1.3 or higher document with digital signature is allowed to be
converted.

User can send such document through Internet into `Czech POINT' system, which
is responsible for so called authorized conversion.

Other direction from analogue form to digital one is possible too. Of course
software can obtain digital output only.

Public conversion interface is web page <https://www.czechpoint.cz/uschovna/>.
There is nice interactive interface with ugly CAPTCHA.

Proprietary client `602XML Filler' uses similar interface that works
automatically. Without CAPTCHA solving obviously. Description of this batch
interface follows.


Digital to Analogue Direction
=============================

Protocol: SOAP
URL: https://www.czechpoint.cz/uschovna/services.php

Input for XSLT is document subtree (rooted in p:dmFile) of ISDS message
Request XSLT:
<xsl:stylesheet xmlns:p="http://isds.czechpoint.cz/v20"
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:xsi="http://www.w3.org/2001/XMLS chema-instance"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
        exclude-result-prefixes="p">
    <xsl:output encoding="UTF-8" method="xml"/>
    <xsl:template match="/">
        <soapenv:Envelope xmlns:ns0="urn:uschovnaWSDL"
                xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <soapenv:Body>
                <ns0:saveDocument>
                    <conversionID soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                            xsi:type="xsd:string">0</conversionID>
                    <fileName soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                            xsi:type="xsd:string">
                        <xsl:value-of select="/p:dmFile/@dmFileDescr"/>
                    </fileName>
                    <document soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                            xsi:type="xsd:base64Binary">
                        <xsl:value-of select="/p:dmFile/p:dmEncodedContent"/>
                    </document>
                </ns0:saveDocument>
            </soapenv:Body>
        </soapenv:Envelope>
    </xsl:template>
</xsl:stylesheet>


Response returns token. Converting officer uses the token to pick up a document
from Czech POINT input storage. Otherwise document expires after 30 days.

According 602XML Filler: Response is standard SOAP Fault error message or
undocumented structure in case of success

According real test:

In case of failure:

<SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:ns1="urn:uschovnaWSDL"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
        <ns1:saveDocumentResponse>
            <return xsi:type="ns1:DocumentSaveResponse">
                <status xsi:type="xsd:int">4</status>
                <statusMsg xsi:type="xsd:string">Neni dokument typu PDF |-1</statusMsg>
                <documentID xsi:nil="true"/>
                <dateInserted xsi:type="xsd:date">2010-02-11</dateInserted>
            </return>
        </ns1:saveDocumentResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

In case of success:

<SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:ns1="urn:uschovnaWSDL"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
        <ns1:saveDocumentResponse>
            <return xsi:type="ns1:DocumentSaveResponse">
                <status xsi:type="xsd:int">0</status>
                <statusMsg xsi:type="xsd:string">OK 1</statusMsg>
                <documentID xsi:type="xsd:string">816236355942291944571</documentID>
                <dateInserted xsi:type="xsd:date">2010-02-12</dateInserted>
            </return>
        </ns1:saveDocumentResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

As you can see the token is returned in
//ns1:saveDocumentResponse/return/documentID/text().


Analogue to Digital Direction
=============================

Officer stores digital document into output storage and provides a token to the user. User has 3 days to download the document.