コード例 #1
0
ファイル: Topic.php プロジェクト: yunwuxin/aliyun_mns
 public function subscribe(SubscriptionAttributes $attributes)
 {
     $attributes->setTopicName($this->topicName);
     $request = new SubscribeRequest($attributes);
     $response = new SubscribeResponse();
     return $this->client->sendRequest($request, $response);
 }
コード例 #2
0
 public function parseResponse($statusCode, $content)
 {
     $this->statusCode = $statusCode;
     if ($statusCode == 200) {
         $this->succeed = TRUE;
     } else {
         $this->parseErrorResponse($statusCode, $content);
     }
     $xmlReader = $this->loadXmlContent($content);
     try {
         $this->attributes = SubscriptionAttributes::fromXML($xmlReader);
     } catch (\Exception $e) {
         throw new MnsException($statusCode, $e->getMessage(), $e);
     } catch (\Throwable $t) {
         throw new MnsException($statusCode, $t->getMessage());
     }
 }
コード例 #3
0
 public function __construct(SubscriptionAttributes $attributes)
 {
     parent::__construct('put', 'topics/' . $attributes->getTopicName() . '/subscriptions/' . $attributes->getSubscriptionName());
     $this->attributes = $attributes;
 }