KiCompanyBasic en: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by one other user not shown) | |||
Line 6: | Line 6: | ||
= Introduction = | = Introduction = | ||
KiCompanyBasic on | <span style="color:#CC0000"> <b> Attention! The service KiCompanyBasic will end on 10/1/2013. We suggest to use [[KiCompany_en | KiCompany]] as an alternative. </b></span> | ||
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 = | = WSDL = | ||
KiCompanyBasic | KiCompanyBasic WDSL is located at [http://services.krediidiinfo.ee/KiCompanyBasic.wsdl http://services.krediidiinfo.ee/KiCompanyBasic.wsdl]. | ||
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'''. | |||
= | |||
= Methods = | |||
== getName == | == getName == | ||
Requesting company’s name. | |||
{| style="border-style: solid; border-width: 1px;" | {| style="border-style: solid; border-width: 1px;" | ||
! | ! | ||
! | ! Name | ||
! | ! Type | ||
! | ! Description | ||
|- | |- | ||
| <b> | | <b>Input parameter:</b> | ||
| regCode | | regCode | ||
| xs:string | | xs:string | ||
| | | Company’s registry code. | ||
|- | |- | ||
| <b> | | <b>Output parameter:</b> | ||
| name | | name | ||
| xs:string | | 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 == | == findCompanies == | ||
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;" | ||
! | ! | ||
! | ! Name | ||
! | ! Type | ||
! | ! Description | ||
|- | |- | ||
| <b> | | <b>Input parameter:</b> | ||
| regCode | | regCode | ||
| xs:string | | xs:string | ||
| | | Company’s registry code | ||
|- | |- | ||
| <b></b> | | <b></b> | ||
| count | | count | ||
| xs:int | | xs:int | ||
| | | Maximum number of companies found in the result of the method (The method does not return at once more than 100 companies) | ||
|- | |- | ||
| <b> | | <b>Output parameter:</b> | ||
| companies | | companies | ||
| ResultCompanyIDDataArray | | ResultCompanyIDDataArray | ||
| | | Indexed array which elements are ResultCompanyIDData array elements. | ||
|} | |} | ||
ResultCompanyIDData | ResultCompanyIDData is a record with the following structure: | ||
{| style="border-style: solid; border-width: 1px;" | {| style="border-style: solid; border-width: 1px;" | ||
! | ! | ||
! | ! Name | ||
! | ! Type | ||
! | ! Description | ||
|- | |- | ||
| regCode | | regCode | ||
| xs:string | | xs:string | ||
| | | Company’s registry code | ||
|- | |- | ||
| name | | name | ||
| xs:string | | xs:string | ||
| | | Company’s name. | ||
|} | |} | ||
== isRegCodeValid == | == isRegCodeValid == | ||
Verification of company’s registry code. | |||
{| style="border-style: solid; border-width: 1px;" | {| style="border-style: solid; border-width: 1px;" | ||
! | ! | ||
! | ! Name | ||
! | ! Type | ||
! | ! Description | ||
|- | |- | ||
| <b> | | <b>Input parameter:</b> | ||
| regCode | | regCode | ||
| xs:string | | xs:string | ||
| | | Company’s registry code | ||
|- | |- | ||
| <b> | | <b>Output parameter:</b> | ||
| isValid | | isValid | ||
| xs:boolean | | xs:boolean | ||
| | | True if registry code given with parameter is an eight-digit number and the last check digit is correct. | ||
|} | |} | ||
= Example in PHP = | |||
Example of using KiCompanyBasic web service in PHP. | |||
<pre> | <pre> | ||
<?php | <?php | ||
/** | /** | ||
* | * Example of using KiCompanyBasic web service of Creditinfo Eesti AS. | ||
*/ | */ | ||
$param = array('encoding'=>'ISO-8859-13'); | $param = array('encoding'=>'ISO-8859-13'); | ||
Line 119: | Line 125: | ||
$regCode = '10256137'; | $regCode = '10256137'; | ||
$name = $client->getName($regCode); | $name = $client->getName($regCode); | ||
echo " | echo "Registry code {$regCode} belongs to the company {$name}\n"; | ||
$regCode = '10256136'; // | $regCode = '10256136'; // check number is invalid! | ||
if (!$client->isRegCodeValid($regCode)) { | if (!$client->isRegCodeValid($regCode)) { | ||
echo " | echo "Registry code is incorrect.\n"; | ||
} else { | } else { | ||
echo " | echo "Registry code is correct\n"; | ||
} | } | ||
?> | ?> | ||
</pre> | </pre> | ||
Program output: | |||
<pre> | <pre> | ||
Line 151: | Line 157: | ||
( | ( | ||
[regCode] => 10256137 | [regCode] => 10256137 | ||
[name] => | [name] => CREDITINFO EESTI AS | ||
) | ) | ||
) | ) | ||
Registry code 10256137 belongs to the company CREDITINFO EESTI AS | |||
Registry code is incorrect. | |||
</pre> | </pre> |
Latest revision as of 14:08, 6 December 2016
eesti keeles |
Introduction
Attention! The service KiCompanyBasic will end on 10/1/2013. We suggest to use KiCompany as an alternative.
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
Verification of company’s registry code.
Name | Type | Description | |
---|---|---|---|
Input parameter: | regCode | xs:string | Company’s registry code |
Output parameter: | isValid | xs:boolean | True if registry code given with parameter is an eight-digit number and the last check digit is correct. |
Example in PHP
Example of using KiCompanyBasic web service in PHP.
<?php /** * Example of using KiCompanyBasic web service of Creditinfo Eesti AS. */ $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 "Registry code {$regCode} belongs to the company {$name}\n"; $regCode = '10256136'; // check number is invalid! if (!$client->isRegCodeValid($regCode)) { echo "Registry code is incorrect.\n"; } else { echo "Registry code is correct\n"; } ?>
Program output:
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] => CREDITINFO EESTI AS ) ) Registry code 10256137 belongs to the company CREDITINFO EESTI AS Registry code is incorrect.