示例#1
0
 /** 
  * Populates the properties with the response from the list rules request.
  * 
  * @param string $response The body of the response of the list rules request. 
  * 
  * @return none
  */
 public function parseXml($response)
 {
     parent::parseXml($response);
     $listRulesResultXml = new \SimpleXMLElement($response);
     $this->_ruleInfos = array();
     foreach ($listRulesResultXml->entry as $entry) {
         $ruleInfo = new RuleInfo();
         $ruleInfo->parseXml($entry->asXml());
         $this->_ruleInfos[] = $ruleInfo;
     }
 }
 /**
  * Gets a rule. 
  *
  * @link http://msdn.microsoft.com/en-us/library/windowsazure/hh780772
  * 
  * @param string $topicPath        The path of the topic.
  * @param string $subscriptionName The name of the subscription.
  * @param string $ruleName         The name of the rule.
  *
  * @return RuleInfo
  */
 public function getRule($topicPath, $subscriptionName, $ruleName)
 {
     $httpCallContext = new HttpCallContext();
     $httpCallContext->setMethod(Resources::HTTP_GET);
     $httpCallContext->addStatusCode(Resources::STATUS_OK);
     $rulePath = sprintf(Resources::RULE_PATH, $topicPath, $subscriptionName, $ruleName);
     $httpCallContext->setPath($rulePath);
     $response = $this->sendContext($httpCallContext);
     $ruleInfo = new RuleInfo();
     $ruleInfo->parseXml($response->getBody());
     return $ruleInfo;
 }