PHP Conference Japan 2024

SoapClient::__getFunctions

(PHP 5, PHP 7, PHP 8)

SoapClient::__getFunctions傳回可用 SOAP 函式的清單

說明

public SoapClient::__getFunctions(): ?array

傳回 Web 服務 WSDL 中描述的函式陣列。

注意:

此函式僅在 WSDL 模式下運作。

參數

此函式沒有參數。

傳回值

SOAP 函式原型 (prototype) 的陣列,詳細說明了傳回類型、函式名稱和參數類型。

範例

範例 #1 SoapClient::__getFunctions() 範例

<?php
$client
= new SoapClient('http://soap.amazon.com/schemas3/AmazonWebServices.wsdl');
var_dump($client->__getFunctions());
?>

以上範例會輸出

array(26) {
  [0]=>
  string(70) "ProductInfo KeywordSearchRequest(KeywordRequest $KeywordSearchRequest)"
  [1]=>
  string(79) "ProductInfo TextStreamSearchRequest(TextStreamRequest $TextStreamSearchRequest)"
  [2]=>
  string(64) "ProductInfo PowerSearchRequest(PowerRequest $PowerSearchRequest)"
...
  [23]=>
  string(107) "ShoppingCart RemoveShoppingCartItemsRequest(RemoveShoppingCartItemsRequest $RemoveShoppingCartItemsRequest)"
  [24]=>
  string(107) "ShoppingCart ModifyShoppingCartItemsRequest(ModifyShoppingCartItemsRequest $ModifyShoppingCartItemsRequest)"
  [25]=>
  string(118) "GetTransactionDetailsResponse GetTransactionDetailsRequest(GetTransactionDetailsRequest $GetTransactionDetailsRequest)"
}

另請參閱

新增註記

使用者貢獻的註記 1 則註記

Beebs
11 年前
以下程式碼對我有效,雖然看起來 soap.amazon.com 已被棄用並停止服務。http://webservices.amazon.com 已取代 Amazon 的 SOAP。

<?php
$client
= new SoapClient('http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl');
var_dump($client->__getFunctions());
?>
To Top