Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Vzorový kód pro přístup k WS CreditCheck z prostředí PHP.

 

 

 

Vzorové metody jsou přizpůsobené pro CZ webovou službu. Pro využití SK WS stačí pozměnit wsdl/location/uri webové služby.

function downloadCreditCheck()
{
    $wsdl = 'http://creditwebservices.creditcheck.cz/CreditCheckAktualizace.asmx?wsdl';
    $cc = new SoapClient($wsdl,  array('location' => "http://creditwebservices.creditcheck.cz/CreditCheckAktualizace.asmx",
        'uri'      => "http://creditcheck.cz/"));
    try {
        $ch = array(
            "Login" => "jmeno",
            "Password" => "heslo",
        );

        $cc->__setSoapHeaders(new SoapHeader("http://creditcheck.cz/", "CreditCheckHeader", $ch));
        $ret = $cc->GetCreditChecks();
    } catch (SoapFault $e) {
        print_r($e);
        $ret = $e->faultstring;
        print_r($ret);
    }

    return $ret;
}


function downloadCreditCheckBatch($batchIndex)
{
    $wsdl = 'http://creditwebservices.creditcheck.cz/CreditCheckAktualizace.asmx?wsdl';
    $cc = new SoapClient($wsdl,  array('location' => "http://creditwebservices.creditcheck.cz/CreditCheckAktualizace.asmx",
        'uri'      => "http://creditcheck.cz/"));
    try {
        $ch = array(
            "Login" => "jmeno",
            "Password" => "heslo",
        );

        $cc->__setSoapHeaders(new SoapHeader("http://creditcheck.cz/", "CreditCheckHeader", $ch));
        $ret = $cc->GetCreditCheckBatch(
            array("lastBatchIndex" => $batchIndex)
        );
    } catch (SoapFault $e) {
        print_r($e);
        $ret = $e->faultstring;
        print_r($ret);
    }

    return $ret;
}

function downloadCreditCheckGetSubjectBasicReport(){
    $wsdl = 'http://creditwebservices.creditcheck.cz/CreditCheckAktualizace.asmx?wsdl';
    $cc = new SoapClient($wsdl,  array('location' => "http://creditwebservices.creditcheck.cz/CreditCheckAktualizace.asmx",
        'uri'      => "http://creditcheck.cz/"));
    try {
        $ch = array(
            "Login" => "jmeno",
            "Password" => "heslo",
        );

        $cc->__setSoapHeaders(new SoapHeader("http://creditcheck.cz/", "CreditCheckHeader", $ch));
        $params = new \SoapVar("
                <GetSubjectBasicReport xmlns='http://creditcheck.cz/'>
                <subjectData>
                <requestSubject xmlns=''>
                  <reportVersion>2</reportVersion>
                  <subjectType>privatePerson</subjectType>
                  <birthNumber>7710109856</birthNumber>
                  <firstName>Jméno</firstName>
                  <surname>Příjmení</surname>
                  <address>
                    <street>Ulice</street>
                    <number>Číslo popisné</number>
                    <city>Město</city>
                    <zip>Psč</zip>
                  </address>
                </requestSubject>
                </subjectData>
                </GetSubjectBasicReport>", XSD_ANYXML);

        $ret = $cc->GetSubjectBasicReport($params);
    } catch (SoapFault $e) {
        print_r($e);
        $ret = $e->faultstring;
        print_r($ret);
    }

    return $ret;
}

 

 

 

  • No labels