/**
  * Call web service with the given parameters
  * @param $params array GET or POST parameters
  * @return DOMDocument or null in case of error
  */
 function &callWebService($url, &$params, $returnType = XSL_TRANSFORMER_DOCTYPE_DOM, $method = 'GET')
 {
     // Create a request
     $webServiceRequest = new WebServiceRequest($url, $params, $method);
     // Configure and call the web service
     $xmlWebService = new XmlWebService();
     $xmlWebService->setReturnType($returnType);
     $result =& $xmlWebService->call($webServiceRequest);
     if (is_null($result)) {
         // Construct a helpful error message including
         // the offending webservice url for get requests.
         $webserviceUrl = $url;
         if ($method == 'GET') {
             $keyValuePairs = array();
             foreach ($params as $key => $value) {
                 $keyValuePairs[] = $key . '=' . $value;
             }
             $webserviceUrl .= '?' . implode('&', $keyValuePairs);
         }
         $translationParams = array('filterName' => $this->getDisplayName(), 'webserviceUrl' => $webserviceUrl, 'httpMethod' => $method);
         $this->addError(__('submission.citations.filter.webserviceError', $translationParams));
     }
     return $result;
 }
 /**
  * Call web service with the given parameters
  * @param $params array GET or POST parameters
  * @return DOMDocument or null in case of error
  */
 function &callWebService($url, &$params, $returnType = XSL_TRANSFORMER_DOCTYPE_DOM, $method = 'GET')
 {
     // Create a request
     $webServiceRequest = new WebServiceRequest($url, $params, $method);
     // Configure and call the web service
     $xmlWebService = new XmlWebService();
     $xmlWebService->setReturnType($returnType);
     $result =& $xmlWebService->call($webServiceRequest);
     return $result;
 }