/**
  * Given a valid servive URI and a valid string of JSON,
  * this method communcates with the SiCDS and returns a
  * list of all unique ID's
  *
  * @param string $uri
  * @param string $json
  * @return string
  */
 public function InterafceWithSiCDS($uri, $json)
 {
     include_once Setup::Modules_Directory() . "/SiSW/ServiceWrapper.php";
     $service = new \Swiftriver\Core\Modules\SiSW\ServiceWrapper($uri);
     $jsonFromService = $service->MakePOSTRequest(array("data" => $json), 5);
     return $jsonFromService;
 }
Esempio n. 2
0
 /**
  * Given a valid servive URI and a valid string of JSON
  * this service wraps the SiCDS service
  *
  * @param string $uri
  * @param string $json
  * @param \Swiftriver\Core\Configuration\ConfigurationHandlers\CoreConfigurationHandler $configuration
  * @return string
  */
 public function InterafceWithService($uri, $parameters, $configuration)
 {
     include_once $configuration->ModulesDirectory . "/SiSW/ServiceWrapper.php";
     $service = new \Swiftriver\Core\Modules\SiSW\ServiceWrapper($uri);
     $return = $service->MakePOSTRequest($parameters, 10);
     return $return;
 }
 public function YahooPlacemakerRequest($location, $appid)
 {
     $encodedLocation = \urlencode($location);
     $url = "http://wherein.yahooapis.com/v1/document";
     $postvars = array("documentContent" => $encodedLocation, "documentType" => "text/plain", "appid" => $appid);
     $serviceWrapper = new \Swiftriver\Core\Modules\SiSW\ServiceWrapper($url);
     $return = $serviceWrapper->MakePOSTRequest($postvars, 10);
     $xml = new \SimpleXMLElement($return);
     $long = (double) $xml->document->placeDetails->place->centroid->longitude;
     $latt = (double) $xml->document->placeDetails->place->centroid->latitude;
     $gis = new \Swiftriver\Core\ObjectModel\GisData($long, $latt, $location);
     return $gis;
 }