SoapClient::__getTypes

(PHP 5, PHP 7, PHP 8)

SoapClient::__getTypesDevuelve una lista de los tipos SOAP

Descripción

public SoapClient::__getTypes(): array

Devuelve un array de los tipos descritos en el WSDL para el servicio web.

Nota:

Esta función funciona sólo en modo WSDL.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Un array de los tipos SOAP, detallando todas las estructuras y los tipos.

Ejemplos

Ejemplo #1 Ejemplo de SoapClient::__getTypes()

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

El resultado del ejemplo sería:

array(88) {
  [0]=>
  string(30) "ProductLine ProductLineArray[]"
  [1]=>
  string(85) "struct ProductLine {
 string Mode;
 string RelevanceRank;
 ProductInfo ProductInfo;
}"
  [2]=>
  string(105) "struct ProductInfo {
 string TotalResults;
 string TotalPages;
 string ListName;
 DetailsArray Details;
}"
...
  [85]=>
  string(32) "ShortSummary ShortSummaryArray[]"
  [86]=>
  string(121) "struct GetTransactionDetailsRequest {
 string tag;
 string devtag;
 string key;
 OrderIdArray OrderIds;
 string locale;
}"
  [87]=>
  string(75) "struct GetTransactionDetailsResponse {
 ShortSummaryArray ShortSummaries;
}"
}

Ver también

  • SoapClient::SoapClient()

add a note add a note

User Contributed Notes 1 note

up
21
felipe dot cwb at hotmail dot com
9 years ago
<?php
// to see formated types

$soap = new SoapClient('http://domain.com/ws.php?WSDL');

echo
'<pre>';
echo
'<h2>Types:</h2>';
$types = $soap->__getTypes();
foreach (
$types as $type) {
   
$type = preg_replace(
        array(
'/(\w+) ([a-zA-Z0-9]+)/', '/\n /'),
        array(
'<font color="green">${1}</font> <font color="blue">${2}</font>', "\n\t"),
       
$type
   
);
    echo
$type;
    echo
"\n\n";
}
echo
'</pre>';
To Top