Andmevahetussüsteemi X-tee liides: Difference between revisions

From services.krediidiinfo.ee
Jump to navigation Jump to search
Line 222: Line 222:
     <xrd:client id:objectType="MEMBER">
     <xrd:client id:objectType="MEMBER">
         <id:xRoadInstance>EE</id:xRoadInstance>
         <id:xRoadInstance>EE</id:xRoadInstance>
         <id:memberClass>XX</id:memberClass>
         <id:memberClass>COM</id:memberClass>
         <id:memberCode>00000000</id:memberCode>
         <id:memberCode>00000000</id:memberCode>
     </xrd:client>
     </xrd:client>

Revision as of 08:59, 25 August 2016

Tutvustus

KRI6 on Krediidiinfo liides, mille vahendusel Osalejad vahetavad krediiditaotleja krediidikohustuste andmeid omavahel X-tee versioon 6 vahendusel. See spetsifikatsioon kirjeldab andmete vahetuse tehnilisi aspekte. KRI6 teenuste kasutamine eeldab, et osaleja on liitunud X-teega.

WSDL

KRI6 WSDL asub aadresslil https://services.krediidiinfo.ee/wsdl/kri6.wsdl.

X-tee sõnum

X-tee päring on vastavalt teenuse kirjeldusele kas

  • SOAP ümbrik
  • või on MIME multipart/related stiilis, mille esimeses osas on SOAP ümbrik.

Vastus on SOAP ümbrik.

SOAP ümbrik koosneb päisest ja kehast.

SOAP ümbriku päis

SOAP ümbriku päises oleva info koosseis on määratud X-tee spetsifikatsiooni poolt.

SOAP ümbriku keha

SOAP ümbriku kehas oleva info koosseis on määratud käesoleva dokumendi poolt.

Päringu soap ümbriku näide

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:kri="urn:kri6">
    <SOAP-ENV:Header>
        <xrd:client id:objectType="MEMBER" xmlns:xrd="http://x-road.eu/xsd/xroad.xsd" xmlns:id="http://x-road.eu/xsd/identifiers">
            <id:xRoadInstance>EE</id:xRoadInstance>
            <id:memberClass>COM</id:memberClass>
            <id:memberCode>10256137</id:memberCode>
        </xrd:client>
        <xrd:service id:objectType="SERVICE" xmlns:xrd="http://x-road.eu/xsd/xroad.xsd" xmlns:id="http://x-road.eu/xsd/identifiers">
            <id:xRoadInstance>EE</id:xRoadInstance>
            <id:memberClass>COM</id:memberClass>
            <id:memberCode>10256137</id:memberCode>
            <id:subsystemCode>posr</id:subsystemCode>
            <id:serviceCode>getSubjectPositiveData</id:serviceCode>
            <id:serviceVersion>v1</id:serviceVersion>
        </xrd:service>
        <xrd:id xmlns:xrd="http://x-road.eu/xsd/xroad.xsd">5734440e50c71</xrd:id>
        <xrd:userId xmlns:xrd="http://x-road.eu/xsd/xroad.xsd">EE00000000000</xrd:userId>
        <xrd:issue xmlns:xrd="http://x-road.eu/xsd/xroad.xsd"/>
        <xrd:protocolVersion xmlns:xrd="http://x-road.eu/xsd/xroad.xsd">4.0</xrd:protocolVersion>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
       <kri:getSubjectPositiveData>
            <subject>
                <ident_code>00000000000</ident_code>
            </subject>
            <is_digi_agreement>1</is_digi_agreement>
            <lang>en</lang>
        </kri:getSubjectPositiveData>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Vastuse soap ümbriku näide

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:kri="urn:kri6">
    <SOAP-ENV:Header>
        <xrd:client id:objectType="MEMBER" xmlns:xrd="http://x-road.eu/xsd/xroad.xsd" xmlns:id="http://x-road.eu/xsd/identifiers">
            <id:xRoadInstance>EE</id:xRoadInstance>
            <id:memberClass>COM</id:memberClass>
            <id:memberCode>10256137</id:memberCode>
        </xrd:client>
        <xrd:service id:objectType="SERVICE" xmlns:xrd="http://x-road.eu/xsd/xroad.xsd" xmlns:id="http://x-road.eu/xsd/identifiers">
            <id:xRoadInstance>EE</id:xRoadInstance>
            <id:memberClass>COM</id:memberClass>
            <id:memberCode>10256137</id:memberCode>
            <id:subsystemCode>posr</id:subsystemCode>
            <id:serviceCode>getSubjectPositiveData</id:serviceCode>
            <id:serviceVersion>v1</id:serviceVersion>
        </xrd:service>
        <xrd:id xmlns:xrd="http://x-road.eu/xsd/xroad.xsd">5734440e50c71</xrd:id>
        <xrd:userId xmlns:xrd="http://x-road.eu/xsd/xroad.xsd">EE00000000000</xrd:userId>
        <xrd:issue xmlns:xrd="http://x-road.eu/xsd/xroad.xsd"/>
        <xrd:protocolVersion xmlns:xrd="http://x-road.eu/xsd/xroad.xsd">4.0</xrd:protocolVersion>
        <xrd:requestHash algorithmId="http://www.w3.org/2001/04/xmlenc#sha512">
            RglGFiBmbZJ0JLwm+vzfGn4fQEIY1YfM81H3SekOw5VnwxO/jilTfHG0zgsaUH9LzLOCqb5YssDz0MbMzm3DhQ==
        </xrd:requestHash>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <kri:getSubjectPositiveDataResponse>
            <subject_positive_data>
                <consumer_credits xmlns:cid="http://www.krediidiinfo.ee/schemas/positive_register/credit_identifiers.xsd">
		    <consumer_credit>
			<cid:type code="O">Other</cid:type>
			<cid:begin_date>2016-07-14</cid:begin_date>
			<cid:end_date>2017-07-14</cid:end_date>
			<cid:sum>200</cid:sum>
			<cid:balance>200</cid:balance>
			<cid:unpaid_sum>7</cid:unpaid_sum>
			<cid:currency>EUR</cid:currency>
			<cid:schedule_payments>
			    <cid:schedule_payment>
				<cid:due_date>2016-10-22</cid:due_date>
				<cid:sum>100.0</cid:sum>
			    </cid:schedule_payment>
			    <cid:schedule_payment>
				<cid:due_date>2017-01-30</cid:due_date>
				<cid:sum>100.0</cid:sum>
			    </cid:schedule_payment>
			</cid:schedule_payments>
			<cid:subject>
			    <cid:ident_code>48508060269</cid:ident_code>
			    <cid:role code="GRT">Guarantor</cid:role>
			</cid:subject>
			<cid:update_datetime>1970-01-01T03:00:00</cid:update_datetime>
		    </consumer_credit>
		</consumer_credits>
		<requests xmlns:cid="http://www.krediidiinfo.ee/schemas/positive_register/credit_identifiers.xsd">
		    <request>
			<cid:datetime>2016-08-10T09:01:38</cid:datetime>
		    </request>
		    <request>
			<cid:datetime>2016-08-15T09:55:56</cid:datetime>
		    </request>
		</requests>
           </subject_positive_data>
           <fault xsi:nil="true"/>
        </kri:getSubjectPositiveDataResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Teenused

getSubjectPositiveData

Krediiditaotleja andmete pärimine Osalejate andmekogudest.

Päringu soap ümbriku keha parameetrid

GetSubjectPositiveData


Vastuse soap ümbriku keha parameetrid

GetSubjectPositiveDataResponse


addSubjectPositiveData

Ühe tarbijakrediidi andmete registreerimine.

Päringu soap ümbriku keha parameetrid

AddSubjectPositiveData


Vastuse soap ümbriku keha parameetrid

AddSubjectPositiveDataResponse


updateSubjectPositiveData

Ühe tarbijakrediidi andmete uuendamine.

Päringu soap ümbriku keha parameetrid

UpdateSubjectPositiveData


Vastuse soap ümbriku keha parameetrid

UpdateSubjectPositiveDataResponse


deleteSubjectPositiveData

Ühe tarbijakrediidi andmete kustutamine.

Päringu soap ümbriku keha parameetrid

DeleteSubjectPositiveData


Vastuse soap ümbriku keha parameetrid

DeleteSubjectPositiveDataResponse


uploadPositiveDataMtom

Kõigi kehtivate tarbijakrediitide andmete sisseimportimine.

Päring

Päring on MTOM/XOP formaadis, mis vastab SOAP multipart/related standardile. Sõnumi esimeses osas on SOAP ümbrik. Sõnumi teises osas on gzip-ga kokkupakkitud ja seejärel base64-ga kodeeritud tarbijakrediitide andmetega xml, mis vastab skeemile http://www.krediidiinfo.ee/schemas/positive_register/data_exchange.xsd.


SOAP ümbriku keha parameetrid on:

UploadPositiveDataMtom


Loaninfo debtors.png


Näitepäring:

...Teised päised
Content-Type: multipart/related; type="application/xop+xml"; start="<xxx>"; start-info="text/xml"; boundary="MIME_boundary"'
MIME-Version: 1.0

--MIME_boundary
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <xxx>

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns1="urn:kri6"
    xmlns:xrd="http://x-road.eu/xsd/xroad.xsd"
    xmlns:id="http://x-road.eu/xsd/identifiers"
    xmlns:inc="http://www.w3.org/2004/08/xop/include">
<SOAP-ENV:Header>
    <xrd:client id:objectType="MEMBER">
        <id:xRoadInstance>EE</id:xRoadInstance>
        <id:memberClass>COM</id:memberClass>
        <id:memberCode>00000000</id:memberCode>
    </xrd:client>
    <xrd:service id:objectType="SERVICE">
        <id:xRoadInstance>EE</id:xRoadInstance>
        <id:memberClass>COM</id:memberClass>
        <id:memberCode>10256137</id:memberCode>
        <id:subsystemCode>posr</id:subsystemCode>
        <id:serviceCode>uploadPositiveDataMtom</id:serviceCode>
        <id:serviceVersion>v1</id:serviceVersion>
    </xrd:service>
    <xrd:id>4894e35d-bf0f-44a6-867a-8e51f1daa7e0</xrd:id>
    <xrd:userId>EE00000000000</xrd:userId>
    <xrd:protocolVersion>4.0</xrd:protocolVersion>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
    <ns1:uploadPositiveDataMtom>
        <positive_data>
            <inc:Include href="cid:xxx"/>
        </positive_data>
    </ns1:uploadPositiveDataMtom>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--MIME_boundary
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-ID: <xxx>
Content-Disposition: attachment;

ZZZ

--MIME_boundary--

Vastuse soap ümbriku keha parameetrid

UploadPositiveDataMtomResponse

uploadPositiveDataStatus

Üleslaetud kõigi kehtivate tarbijakrediitide andmete alusel tekitatud faili töötlemise staatuse pärimine.

Päringu soap ümbriku keha parameetrid

UploadPositiveDataStatus


Vastuse soap ümbriku keha parameetrid

UploadPositiveDataStatusResponse


Tehniline viga

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
	<SOAP-ENV:Body>
		<SOAP-ENV:Fault>
			<faultcode>SOAP-ENV:Server</faultcode>
			<faultstring>Veateade</faultstring>
			<faultactor/>
			<detail>
				<faultCode>0</faultCode>
				<faultString>Veateade</faultString>
			</detail>
		</SOAP-ENV:Fault>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>