KiCompanyBasic en: Difference between revisions

From services.krediidiinfo.ee
Jump to navigation Jump to search
No edit summary
No edit summary
Line 11: Line 11:
= WSDL =
= WSDL =


KiCompanyBasic WSDL asub aadressil [http://services.krediidiinfo.ee/KiCompanyBasic.wsdl http://services.krediidiinfo.ee/KiCompanyBasic.wsdl].
KiCompanyBasic WDSL is located at  [http://services.krediidiinfo.ee/KiCompanyBasic.wsdl http://services.krediidiinfo.ee/KiCompanyBasic.wsdl].


Microsofti arendusvahendite kasutajate jaoks on tehtud teine WSDL: [http://services.krediidiinfo.ee/KiCompanyBasicLit.wsdl http://services.krediidiinfo.ee/KiCompanyBasicLit.wsdl]. See erineb varasemast WSDL-ist selle poolest, et ''RPC/encode'' asemel kasutatakse ''RPC/litteral''-i.
WSDL for users of Microsoft Development Tools is located at: [http://services.krediidiinfo.ee/KiCompanyBasicLit.wsdl http://services.krediidiinfo.ee/KiCompanyBasicLit.wsdl]. It differs from the previous WSDL in that '''RPC/litteral''' is used instead of '''RPC/encode'''.


= Meetodid =  
 
= Methods =  


== getName ==
== getName ==


Ettevõtte nime pärimine.
Requesting company’s name.


{| style="border-style: solid; border-width: 1px;"
{| style="border-style: solid; border-width: 1px;"
!  
!  
! Nimi
! Name
! Tüüp
! Type
! Kirjeldus
! Description
|-
|-
| <b>Sisendparameetrid:</b>  
| <b>Input parameter:</b>  
| regCode
| regCode
| xs:string
| xs:string
| Ettevõtte äriregistri kood.
| Company’s registry code.
|-
|-
| <b>Väljundparameeter:</b>
| <b>Output parameter:</b>
| name
| name
| xs:string
| xs:string
| Ettevõtte nimi. Kui ettevõtte nime ei leita (sellise nimega ettevõtet ei eksisteeri, ettevõtte äriregistrikood vigane vms), siis on väljundparameetri väärtuseks tühistring.
| Company’s name. Output value is an empty string if the name is not found (compnay does not exist, error in the registry code etc).  
|}
|}


== findCompanies ==
== findCompanies ==


Ettevõtete otsimine nime järgi. Tulemuseks on massiiv, mis sisaldab otsingustringile sobivate ettevõtete nimesid ja äriregistrikoode.
Searching companies by name. The result is an array, which includes companies’ names and registry codes according to the search string.


{| style="border-style: solid; border-width: 1px;"
{| style="border-style: solid; border-width: 1px;"
!  
!  
! Nimi
! Name
! Tüüp
! Type
! Kirjeldus
! Description
|-
|-
| <b>Sisendparameetrid:</b>  
| <b>Input parameter:</b>  
| regCode
| regCode
| xs:string
| xs:string
| Ettevõtte äriregistri kood
| Company’s registry code
|-
|-
| <b></b>  
| <b></b>  
| count
| count
| xs:int
| xs:int
| Leitud ettevõtete maksimaalne arv, mis meetodi tulemuses võib olla. (Meetod ei tagasta korraga rohkem kui 100 ettevõtet)
| Maximum number of companies found in the result of the method (The method does not return at once more than 100 companies)  
|-
|-
| <b>Väljundparameeter:</b>
| <b>Output parameter:</b>
| companies
| companies
| ResultCompanyIDDataArray
| ResultCompanyIDDataArray
| Indekseeritud massiiv, mille elementideks on ResultCompanyIDData tüüpi elemendid.
| Indexed array which elements are ResultCompanyIDData array elements.
|}
|}


ResultCompanyIDData on kirje järgmise struktuuriga:
ResultCompanyIDData is a record with the following structure:


{| style="border-style: solid; border-width: 1px;"
{| style="border-style: solid; border-width: 1px;"
!  
!  
! Nimi
! Name
! Tüüp
! Type
! Kirjeldus
! Description
|-
|-
| regCode
| regCode
| xs:string
| xs:string
| Ettevõtte äriregistri kood
| Company’s registry code
|-
|-
| name
| name
| xs:string
| xs:string
| Ettevõtte nimi.
| Company’s name.
|}
|}


== isRegCodeValid ==
== isRegCodeValid ==

Revision as of 14:53, 6 June 2012

Flag of Estonia.svg eesti keeles


Introduction

KiCompanyBasic is the name of a Web Service based on SOAP protocol for requesting companies’ register codes. KiCompanyBasic requests are free of charge up to 500 queries per month.


WSDL

KiCompanyBasic WDSL is located at http://services.krediidiinfo.ee/KiCompanyBasic.wsdl.

WSDL for users of Microsoft Development Tools is located at: http://services.krediidiinfo.ee/KiCompanyBasicLit.wsdl. It differs from the previous WSDL in that RPC/litteral is used instead of RPC/encode.


Methods

getName

Requesting company’s name.

Name Type Description
Input parameter: regCode xs:string Company’s registry code.
Output parameter: name xs:string Company’s name. Output value is an empty string if the name is not found (compnay does not exist, error in the registry code etc).


findCompanies

Searching companies by name. The result is an array, which includes companies’ names and registry codes according to the search string.

Name Type Description
Input parameter: regCode xs:string Company’s registry code
count xs:int Maximum number of companies found in the result of the method (The method does not return at once more than 100 companies)
Output parameter: companies ResultCompanyIDDataArray Indexed array which elements are ResultCompanyIDData array elements.

ResultCompanyIDData is a record with the following structure:

Name Type Description
regCode xs:string Company’s registry code
name xs:string Company’s name.


isRegCodeValid

Ettevõtte äriregistri korrektsuse kontrollimine.

Nimi Tüüp Kirjeldus
Sisendparameetrid: regCode xs:string Ettevõtte äriregistri kood
Väljundparameeter: isValid xs:boolean Tõene, kui parameetriga ette antud äriregistri kood on kaheksakohaline arv ja viimane kontrollnumber on õige.

Näidisprogramm PHP-s

Järgnevalt on toodud PHP-s kirjutatud KiCompanyBasic veebiteenuse kasutamise näide.

<?php
/**
 * Krediidiinfo KiCompanyBasic veebiteenuse kasutamise näidis.
 */
$param = array('encoding'=>'ISO-8859-13');
$client = new SoapClient('http://services.krediidiinfo.ee/KiCompanyBasic.wsdl', $param);

$name = 'KREDIIDI';
$companies = $client->findCompanies($name, 3);
print_r($companies);

$regCode = '10256137';
$name = $client->getName($regCode);
echo "Äriregistri kood {$regCode} kuulub ettevõttele {$name}\n";

$regCode = '10256136'; // kontrollnumber on vale!
if (!$client->isRegCodeValid($regCode)) {
    echo "Äriregistri kood on vigane.\n";
} else {
    echo "Äriregistri kood on korrektne\n";
}
?>

Programmi väljund:


Array
(
    [0] => Array
        (
            [regCode] => 90006012
            [name] => KREDIIDI JA EKSPORDI GARANTEERIMISE  SITHASUTUS KREDEX
        )

    [1] => Array
        (
            [regCode] => 10704587
            [name] => KREDIIDI JÄRELVALVE OÜ
        )

    [2] => Array
        (
            [regCode] => 10256137
            [name] => KREDIIDIINFO AS
        )

)
Äriregistri kood 10256137 kuulub ettevõttele KREDIIDIINFO AS
Äriregistri kood on vigane.