コード例 #1
0
 /**
  * Controller method for synching taxon groups with the Species Dictionary.
  */
 public function taxon_groups_sync()
 {
     require DOCROOT . 'modules/nbn_species_dict_sync/lib/nusoap.php';
     $client = new nusoap_client('http://www.nbnws.net/ws_3_5/GatewayWebService?wsdl', true);
     $client->setGlobalDebugLevel(0);
     $query1 = '<TaxonReportingCategoryListRequest xmlns="http://www.nbnws.net/TaxonReportingCategory" registrationKey="' . kohana::config('nbn_species_dict_sync.registration_key') . '">' . '</TaxonReportingCategoryListRequest>';
     $response = $client->call('GetTaxonReportingCategoryList', $query1);
     $error = $client->getError();
     if ($error) {
         $this->error($error, $message, $messageType);
     } else {
         $this->sync_taxon_groups($response['TaxonReportingCategoryList']['TaxonReportingCategory']);
         $message = "Synchronisation completed OK";
     }
     if (request::is_ajax()) {
         echo $message;
     } else {
         $this->session = new Session();
         $this->session->set_flash("flash_{$messageType}", $message);
         url::redirect('taxon_group?tab=NBN_Sync');
     }
 }