以下程式碼對我有效,雖然看起來 soap.amazon.com 已被棄用並停止服務。http://webservices.amazon.com 已取代 Amazon 的 SOAP。
<?php
$client = new SoapClient('http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl');
var_dump($client->__getFunctions());
?>
(PHP 5, PHP 7, PHP 8)
SoapClient::__getFunctions — 傳回可用 SOAP 函式的清單
此函式沒有參數。
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)" }
以下程式碼對我有效,雖然看起來 soap.amazon.com 已被棄用並停止服務。http://webservices.amazon.com 已取代 Amazon 的 SOAP。
<?php
$client = new SoapClient('http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl');
var_dump($client->__getFunctions());
?>