array ( 'HTTP Response' => 400, 'Message' => 'Unknown Error' ), 1 => array ( 'HTTP Response' => 200, 'Message' => 'Success' ), 2 => array ( 'HTTP Response' => 403, 'Message' => 'HTTPS Required' ), 3 => array ( 'HTTP Response' => 401, 'Message' => 'Authentication Required' ), 4 => array ( 'HTTP Response' => 401, 'Message' => 'Authentication Failed' ), 5 => array ( 'HTTP Response' => 404, 'Message' => 'Invalid Request' ), 6 => array ( 'HTTP Response' => 400, 'Message' => 'Invalid Response Format' ) ); $model = new SearchForm (); $filters = array (); if (isset ( $_GET ['unitID'] )) { $filters ['unitID'] = $_GET ['unitID']; } else { $filters ['unitID'] = '*'; } if (isset ( $_GET ['sampleType'] )) { $filters ['sampletype'] = $_GET ['sampleType']; } if (isset ( $_GET ['name'] )) { $filters ['fullScientificName'] = $_GET ['name']; } if (isset ( $_GET ['country'] )) { $filters ['country'] = $_GET ['country']; } if (isset ( $_GET ['isocountry'] )) { $filters ['countryisocode'] = $_GET ['isocountry']; } $model->attributes = $filters; $criteria = SOLRQueryManager::createSearchQuery ( $model, $filters ); $raw_response = SOLRQueryManager::getQueryResponse ( $criteria, $model ); $response = array ( $raw_response->getResponse ()->responseHeader, $raw_response->getResponse ()->response ); // $response = $raw_response->getResponse (); bei erzwungenem wt=json geht es nur so, aber dann knallts bei den Facet-Suchen... $requestString = $raw_response->getRawRequest (); echo "Hello World! This is a first test for API RESTful Webservice on GGBN index. Data retrieved from SOLR index using portal queries. Yeah! TODO: encoding somehow wrong, but hex-unicode seems to be a browser problem only; wt=xml looks strange, since json is output format; can enforce wt=json, but than portal facet search is no longer working check whether to use one SOLR core for portal and API or better two separate cores -> need specification what is required from third parties such as EOL, GBIF, INSDC, and EDIT If we can use same SOLR core for both would it be easier to use the web service for portal too? Currently working parameters: unitID, sampleType, name, country, isocountry "; echo urldecode ( $requestString ) . " "; $format = 'json'; $response ['code'] = 0; $response ['status'] = $api_response_code [$response ['code']] ['HTTP Response']; // $response['data'] = 'Hello World'; WebService::deliver_response ( $format, $response ); return; } }