ConsumerId = '006'; $gServiceHeader->Provider = new StdClass; $gServiceHeader->Provider->ProviderId = '001'; $gServiceHeader->Provider->CountryCode = 'BE'; $gServiceHeader->TimeStamp = date('Y-m-d\TH:i:s'); $gServiceHeader->TestIndication = true; $soap_header = new SoapHeader('http://services.giant-net.com/'. 'schema/services/shared/1.0', 'ServiceHeader', $gServiceHeader); $soap_client = new SoapClient('https://giant-tst.graydon.nl/search/v1?wsdl', array('soap_version' => SOAP_1_1, 'login' => '006', 'password' => 'ClaudeMonet', 'trace' => true)); $soap_client->__setSoapHeaders($soap_header); $o = new StdClass; $o->IncludePhoneticMatches = 'false'; if (empty($siret) == false) { $o->Query = new StdClass; $o->Query->VatNumber = $siret; $o->IncludeSuggestions = 'false'; $fonction = 'AdvancedSearch'; } else { $o->Query = "$raisonSociale $numVoie $libVoie $cp $ville"; $o->IncludeSuggestions = 'true'; $fonction = 'Search'; } try { $O = $soap_client->__call($fonction, array($o)); } catch (SoapFault $f) { print_r($f); print '
'; print 'Requete: '. htmlspecialchars($soap_client->__getLastRequest()); print '
'; print 'Reponse: '. htmlspecialchars($soap_client->__getLastResponse()); } // --------------------------------------------------------------------------- // // afficheCompany // --------------------------------------------------------------------------- // function afficheCompany(&$c, $deb, $num) { print '
  • '; print ''. $c->RegisteredName.'
    '; print 'Register number '.$c->CompanyRegisterNumber.'
    '; print 'VAT '.$c->VatNumber.'
    '; print $c->Address->HouseNumber.' '. $c->Address->AddressType.' '; if (isset($c->Address->Street) == true) { print $c->Address->Street; } print '
    '; print ''.$c->Address->PostCode.' '; if (isset($c->Address->City) == true) { print $c->Address->City; } print '
    '; print 'Forme : '.$c->LegalForm.'
    '; print '
    '; } // --------------------------------------------------------------------------- // // affichage // --------------------------------------------------------------------------- // print '
      '; if (is_array($O->Results->Company) == true) { foreach ($O->Results->Company as $i => $c) { afficheCompany($c, $O->StartRow, $i); } } else { afficheCompany($O->Results->Company, 0, 0); } print '
    '; ?>