當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseType::toRequestXml方法代碼示例

本文整理匯總了PHP中DTS\eBaySDK\Types\BaseType::toRequestXml方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseType::toRequestXml方法的具體用法?PHP BaseType::toRequestXml怎麽用?PHP BaseType::toRequestXml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DTS\eBaySDK\Types\BaseType的用法示例。


在下文中一共展示了BaseType::toRequestXml方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildXopDocument

 /**
  * Builds the XOP document part of the request body string.
  *
  * @param \DTS\eBaySDK\Types\BaseType $request Request object containing the request information.
  *
  * @return string The XOP document part of request body.
  */
 private function buildXopDocument(\DTS\eBaySDK\Types\BaseType $request)
 {
     return sprintf('%s%s%s%s%s', '--MIME_boundary' . self::CRLF, 'Content-Type: application/xop+xml;charset=UTF-8;type="text/xml"' . self::CRLF, 'Content-Transfer-Encoding: 8bit' . self::CRLF, 'Content-ID: <request.xml@devbay.net>' . self::CRLF . self::CRLF, $request->toRequestXml() . self::CRLF);
 }
開發者ID:jasonthebomb,項目名稱:eBayService,代碼行數:11,代碼來源:BaseService.php

示例2: callOperation

 /**
  * Sends an API request.
  *
  * @param string $name The name of the operation.
  * @param \DTS\eBaySDK\Types\BaseType $request Request object containing the request information.
  * @param string The name of the PHP class that will be created from the XML response.
  *
  * @return mixed A response object created from the XML respose.
  */
 protected function callOperation($name, \DTS\eBaySDK\Types\BaseType $request, $responseClass)
 {
     $debug = $this->config('debug');
     $url = $this->getUrl();
     $body = $request->toRequestXml();
     $headers = $this->getEbayHeaders($name);
     $headers['Content-Type'] = 'text/xml';
     $headers['Content-Length'] = strlen($body);
     if ($debug) {
         $this->logRequest($url, $name, $headers, $body);
     }
     $response = $this->httpClient->post($url, $headers, $body);
     if ($debug) {
         $this->logResponse($response);
     }
     $xmlParser = new XmlParser($responseClass);
     return $xmlParser->parse($response);
 }
開發者ID:bryon-czoch,項目名稱:eBay-CLI,代碼行數:27,代碼來源:BaseService.php


注:本文中的DTS\eBaySDK\Types\BaseType::toRequestXml方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。