Exemplo n.º 1
0
 /**
  * This method is an internal method used by parseXML method.
  *
  * @param elem XML element object.
  * @param responseSet Response Set.
  */
 public function setResponseSetAttributes($elem, ResponseSet $responseSet)
 {
     // get vers attribute
     $temp = $elem->getAttribute("vers");
     if ($temp != null) {
         $responseSet->setResponseSetVersion($temp);
     }
     // get service id
     $temp = $elem->getAttribute("svcid");
     if ($temp != null) {
         $responseSet->setServiceID($temp);
     }
     // get request id
     $temp = $elem->getAttribute("reqid");
     if ($temp != null) {
         $responseSet->setRequestSetID($temp);
     }
 }
Exemplo n.º 2
0
 private static function send($url, $cookies, RequestSet $set, $cookieTable)
 {
     $bits = parse_url($url);
     $host = $bits['host'];
     $port = isset($bits['port']) ? $bits['port'] : 80;
     $path = isset($bits['path']) ? $bits['path'] : '/';
     $conn = new HttpClient($host, $port);
     $conn->setCookies($cookieTable);
     $conn->setContentType("text/xml;charset=UTF-8");
     // Output ...
     $xml = $set->toXMLString();
     if (!$conn->post($path, $xml)) {
         throw new Exception("PLLClient send exception");
     }
     // Input ...
     $in_string = $conn->getContent();
     $cookieTable = $conn->getCookies();
     $resset = ResponseSet::parseXML($in_string);
     return $resset->getResponses();
 }