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


PHP SoapClient::__getTypes方法代碼示例

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


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

示例1: run

 /**
  * generate model files
  */
 public function run()
 {
     foreach ($this->soapClient->__getTypes() as $t) {
         $typeContent = $this->getTypeContent($t);
         if (is_array($typeContent) && isset($typeContent['content'])) {
             $file = SOAP_OUTPUT_BASE_DIR . '/' . SOAP_MODEL_DIR . '/' . $typeContent['class'] . '.class.php';
             if (file_put_contents($file, $typeContent['content']) === false) {
                 $this->logger->err('can not write file ' . $file . ' check if permissions are correct.');
             } else {
                 $this->logger->debug('write new model file: ' . $file);
             }
         }
     }
 }
開發者ID:PhDasen,項目名稱:php_soap_client_mu,代碼行數:17,代碼來源:PlentymarketsSoapModelGenerator.class.php

示例2: index

 /**
  * 首頁
  */
 public function index()
 {
     if (!class_exists("SoapClient")) {
         exit("請開啟Soap擴展!");
     }
     $ws = "http://www.webservicex.net/globalweather.asmx?wsdl";
     //webservice服務的地址
     $ws = "http://122.224.230.4:18003/newyorkWS/ws/CheckGoodsDecl?wsdl";
     //        $ws = "http://122.224.230.4:18003/newyorkWS/ws/ReceivedDeclare?wsdl";
     $client = new \SoapClient($ws);
     /*
      * 獲取SoapClient對象引用的服務所提供的所有方法
      */
     echo "SOAP服務器提供的開放函數:";
     echo '<pre>';
     var_dump($client->__getFunctions());
     //獲取服務器上提供的方法
     echo '</pre>';
     echo "SOAP服務器提供的Type:";
     echo '<pre>';
     var_dump($client->__getTypes());
     //獲取服務器上數據類型
     echo '</pre>';
     echo "執行GetGUIDNode的結果:";
     //        $result=$client->checkReceived(array('xmlStr'=>'zhengzhou','xmlType'=>'IMPORT_COMPANY','sourceType'=>'1'));//查詢中國鄭州的天氣,返回的是一個結構體
     //        var_dump($result);
     $result = $client->check(array('companyCode' => 'zhengzhou', 'subCarriageNo' => '1'));
     //查詢中國鄭州的天氣,返回的是一個結構體
     dump(simplexml_load_string($result->return));
     //        $this->display();
     //        echo $result->return;
     exit;
 }
開發者ID:h136799711,項目名稱:2015boye_api,代碼行數:36,代碼來源:IndexController.class.php

示例3: checkSoapClient

 private function checkSoapClient()
 {
     try {
         $defaultTimeout = ini_get("default_socket_timeout");
         ini_set("default_socket_timeout", 15);
         $soapClient = new \SoapClient($this->getWSDLUrl());
         $this->aMethods = $soapClient->__getFunctions();
         $this->aTypes = $soapClient->__getTypes();
         $this->setEstado(true);
     } catch (SoapFault $f) {
         $mensajeError = '';
         $msg = $f->faultstring;
         if (strstr($msg, 'failed to load external entity')) {
             $mensajeError = 'Error de conexi&oacute;n - ';
         } else {
             if ($f->faultcode == 'HTTP' && strstr(strtolower($f->faultstring), 'error fetching http headers')) {
                 $mensajeError = 'Tiempo de espera superado - ';
             }
         }
         $mensajeError .= $msg;
         $this->setEstado(false);
         $this->setMensaje($mensajeError);
     }
     ini_set("default_socket_timeout", $defaultTimeout);
     return $this->getEstado();
 }
開發者ID:juyagu,項目名稱:Analia,代碼行數:26,代碼來源:WebService.php

示例4: createFromClient

 /**
  * Возвращает экземпляр Resolver на основе переданного SOAP клиента
  *
  * @param \SoapClient $client Клиент
  *
  * @return Resolver
  */
 public static function createFromClient(\SoapClient $client)
 {
     $functions = $client->__getFunctions();
     $types = $client->__getTypes();
     $functionParser = new FunctionParser($functions);
     $typeParser = new TypeParser($types);
     return new Resolver($functionParser->getFunctions(), $typeParser->getTypes());
 }
開發者ID:itmh,項目名稱:wsdl-types-resolver,代碼行數:15,代碼來源:ResolverFactory.php

示例5: getTypes

 /**
  * Return a list of SOAP types
  *
  * @return array
  * @throws Zend_Soap_Client_Exception
  */
 public function getTypes()
 {
     if ($this->getWsdl() == null) {
         throw new Zend_Soap_Client_Exception('\'getTypes\' method is available only in WSDL mode.');
     }
     if ($this->_soapClient == null) {
         $this->_initSoapClientObject();
     }
     return $this->_soapClient->__getTypes();
 }
開發者ID:dragonlet,項目名稱:clearhealth,代碼行數:16,代碼來源:Client.php

示例6: SoapClient

 function __construct($wsdlurl)
 {
     $client = new SoapClient($wsdlurl);
     $functions = $client->__getFunctions();
     $typeStrings = $client->__getTypes();
     $types = array();
     foreach ($typeStrings as $t) {
         $types = $types + $this->extractParameterInfo($t);
     }
     $this->types = $types;
     $operations = array();
     foreach ($functions as $f) {
         $operation = $this->extractFunctionInfo($types, $f);
         $key = $operation->toString();
         if (!array_key_exists($key, $operations)) {
             $operations[$key] = $operation;
         }
     }
     $this->operations = $operations;
     // 			var_dump($client->);
     // 			echo "<br />";
 }
開發者ID:pankajsaha,項目名稱:airavata-sandbox,代碼行數:22,代碼來源:wsdlparser.php

示例7: __getTypes

 /**
  * @link http://php.net/manual/en/soapclient.gettypes.php
  *
  * @return array
  */
 public function __getTypes()
 {
     return parent::__getTypes();
 }
開發者ID:jeremylivingston,項目名稱:core-proxies,代碼行數:9,代碼來源:SoapClient.php

示例8: fun_NWMLS_getSoapInfo

 /**
  * figure out what soap functions and types are available
  * @param object $client Soap Client
  * @returns string $Response soap result
  */
 public function fun_NWMLS_getSoapInfo()
 {
     $WSDL = $this->WSDL;
     $client = new SoapClient($WSDL, array('trace' => 1));
     //trace for getLastResponse();
     //debug (and figuring out what to do!)
     //get functions and params
     var_dump($client->__getFunctions());
     var_dump($client->__getTypes());
     $Response = $client->__getLastResponse();
     echo "\n\n\n";
     echo "Response:{$Response}\n";
     echo "\n\n\n";
     //debug
     //echo "REQUEST:\n" . $client->__getLastRequest() . "\n"; //Shows query just sent
     //echo "RESPONSE:\n" . $client->__getLastResponse() . "\n"; //gets the data
     return $Response;
 }
開發者ID:realtybutler,項目名稱:nwmls-php,代碼行數:23,代碼來源:class_nwmls.php

示例9: catch

    echo "<td>";
    echo "<pre>" . print_r($client->__getFunctions(), true) . "</pre>";
    echo "</td>";
    echo "</tr>";
    echo "</tbody>";
    echo "</table>";
    echo "<table>";
    echo "<thead>";
    echo "<tr align='left'>";
    echo "<th>__getTypes()</th>";
    echo "</tr>";
    echo "</thead>";
    echo "<tbody>";
    echo "<tr>";
    echo "<td>";
    echo "<pre>" . print_r($client->__getTypes(), true) . "</pre>";
    echo "</td>";
    echo "</tr>";
    echo "</tbody>";
    echo "</table>";
} catch (SoapFault $fault) {
    echo "<table>";
    echo "<thead>";
    echo "<tr>";
    echo "<th>SOAP Fault</th>";
    echo "</tr>";
    echo "</thead>";
    echo "<tbody>";
    echo "<tr>";
    echo "<td>";
    echo "<pre>";
開發者ID:jfsbarreto,項目名稱:BlackTDN,代碼行數:31,代碼來源:ubtdntview08.php

示例10: SoapClient

<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
ini_set('soap.wsdl_cache_enabled', '0');
//關閉緩存
$soap = new SoapClient('http://wl.com/api.php/soap/op/api');
echo "提供的方法\n";
print_r($soap->__getFunctions());
echo "相關的數據結構\n";
print_r($soap->__getTypes());
var_dump($soap->receive(array('arg0' => file_get_contents(SITE_ROOT . 'YUN.xml')))->return);
開發者ID:xiangku7890,項目名稱:basic,代碼行數:15,代碼來源:wsdl.php

示例11: var_dump

<?php

ini_set("soap.wsdl_cache_enabled", "0");
$myClient = new SoapClient("http://rtls.gg/ws/wsdl.php");
foreach ($myClient->__getFunctions() as $item) {
    echo $item . "<br>";
}
echo "<hr>";
foreach ($myClient->__getTypes() as $item) {
    echo $item . "<br>";
}
echo "<hr>";
echo var_dump($myClient->getPeople());
/*
foreach($myClient->getPeople() as $item) {
	echo $item->getFullName();
}
*/
開發者ID:edmarbarbosa,項目名稱:newt-rtls,代碼行數:18,代碼來源:testClientSOAP.php

示例12: SoapClient

<?php

//load the wsdl file
$client = new SoapClient("http://example.com/soap/definition.wsdl");
//functions are now available to be called
$result = $client->soapFunc("hello");
$result = $client->anotherSoapFunc(34234);
//SOAP Information
$client = new SoapClient("http://example.com/soap/definition.wsdl");
//list of SOAP types
print_r($client->__getTypes());
//list if SOAP Functions
print_r($client->__getFunctions());
開發者ID:Gecko136,項目名稱:RosettaCodeData,代碼行數:13,代碼來源:soap.php

示例13: __construct

    /**
     * Instantiate service, set SOAP header with credentials
     *
     * @param string $wsdl      Path to WSDL
     * @param string $username  Username
     * @param string $password  Password 
     */
    public function __construct($wsdl, $username, $password)
    {
        $params = array('encoding' => 'utf-8', 'trace' => 1, 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP);
        $client = new SoapClient($wsdl, $params);
        $classmap = array();
        // at a high level, the following code takes a SOAP struct definition and
        // translates it to valid PHP, which then gets eval()ed, so we can pass
        // the resulting classes as the classmap param to the SoapClient ctor,
        // which means we'll return the correct type of obj instead of stdClass.
        foreach ($client->__getTypes() as $type) {
            $tokens = SoapTypeTokenizer::tokenize($type);
            $len = count($tokens);
            $properties['classes'] = array();
            $properties['other'] = array();
            if ($tokens[0]['token'] !== SOAP_TYPE_STRUCT) {
                continue;
            }
            // ignore types that aren't structs
            for ($i = 0; $i < $len; ++$i) {
                $code = $tokens[$i]['code'];
                $token = $tokens[$i]['token'];
                if ($code === SOAP_NATIVE_TYPE) {
                    if ($token === SOAP_TYPE_STRUCT) {
                        $classCode = 'class ';
                        $i += 2;
                        // skip whitespace token
                        $code = $tokens[$i]['code'];
                        $token = $tokens[$i]['token'];
                        // token is now the name of the struct
                        // add to classmap
                        $classmap[$token] = $token;
                        // if class exists (classes can be user-defined if add'l functionality is desired)
                        // we still want it in the classmap (above), but we don't want to re-declare it.
                        if (class_exists($token)) {
                            continue 2;
                        }
                        $classCode .= $token . ' {';
                        $i += 3;
                        // skip whitespace, semicolon tokens
                    } else {
                        // some sort of SOAP type for a property, like dateTime
                        // we don't care about it, we just want the name
                        $i += 2;
                        // skip whitespace token
                        $name = $tokens[$i]['token'];
                        $properties['other'][] = $name;
                    }
                } elseif ($code === SOAP_USER_TYPE) {
                    // user-defined class
                    $i += 2;
                    // skip whitespace token
                    $name = $tokens[$i]['token'];
                    $properties['classes'][$name] = $token;
                }
            }
            // property definition section
            foreach ($properties['classes'] as $key => $class) {
                $classCode .= 'public $' . $key . ';';
            }
            foreach ($properties['other'] as $class) {
                $classCode .= 'public $' . $class . ';';
            }
            // create ctor
            $classCode .= 'public function __construct(';
            // populate ctor args
            foreach ($properties['other'] as $key => $class) {
                $classCode .= '$' . $class . ' = null,';
            }
            // remove extraneous trailing ',' if there
            if (substr($classCode, -1, 1) === ',') {
                $classCode = substr($classCode, 0, -1);
            }
            // close args
            $classCode .= ')';
            // open ctor
            $classCode .= '{';
            // store ctor args as class properties
            foreach ($properties['other'] as $key => $class) {
                $classCode .= '$this->' . $class . ' = $' . $class . ';';
            }
            // instantiate member properties that are classes
            foreach ($properties['classes'] as $key => $class) {
                $classCode .= '$this->' . $key . ' = new ' . $class . '();';
            }
            // close ctor
            $classCode .= '}';
            // close class
            $classCode .= '}';
            eval($classCode);
        }
        // create another instance of the SoapClient, this time using the classmap
        $params['classmap'] = $classmap;
        $this->_instance = new SoapClient($wsdl, $params);
//.........這裏部分代碼省略.........
開發者ID:premreva1987,項目名稱:eloqua-php-sdk,代碼行數:101,代碼來源:EloquaServiceClient.php

示例14: SoapClient

echo '<br/>';
$client = new SoapClient("https://webportal.gtldc.net/InmatePin/InmateService.svc?wsdl");
//$client->__setLocation("https://webportal.gtldc.net/InmatePin/InmateService.svc/basic");
//$response = $client->MethodName(array( "paramName" => "paramValue" ... ));
echo 'Connection made';
echo '<br/>';
echo 'setting up security';
echo '<br/>';
try {
    $availFunctions = $client->__getFunctions();
    foreach ($availFunctions as $value) {
        //echo $value;
        //echo '<br/>';
    }
    echo '<br/>';
    $availClass = $client->__getTypes();
    foreach ($availClass as $value) {
        //echo $value;
        //echo '<br/>';
    }
    echo '<br/>';
    $securityID = '';
    $transID = '';
    //$SOAPsecurityID = new SoapVar("Guid", "{F0ACB09E-42BC-4EFB-B73F-B2207CE47973}");
    //$securityID = $client->guid("{F0ACB09E-42BC-4EFB-B73F-B2207CE47973}");
    $subID = "CI01";
    //$transID = $client->Guid->NewGuid();
    echo 'Security setting created';
    echo '<br/>';
    $params = array('transID' => $transID, 'securityID' => '{F0ACB09E-42BC-4EFB-B73F-B2207CE47973}', 'inmateid' => "111111", 'subID' => $subID, 'comment' => "Test Search");
    $getInfo = $client->InmateGetInfo($params);
開發者ID:rwgt0su,項目名稱:web-time-sheet,代碼行數:31,代碼來源:test_1.php

示例15: die

<?php

if (!isset($_GET['wsdl'])) {
    die("Invalid parameters");
}
// $wsdl = 'http://www.sxzkc.cn/Tools/SwfUpload/SwfUploadService.asmx?wsdl';
header('Content-Type: application/json');
try {
    $wsdl = $_GET['wsdl'];
    $xmldata = @file_get_contents($wsdl);
    $client = new SoapClient($wsdl);
    $result = array();
    $data = array('init' => true);
    foreach ($client->__getTypes() as $type) {
        foreach (explode("\n", $type) as $line) {
            if (preg_match('/struct ([^\\s]+)\\s+{/', $line, $matches)) {
                if (!isset($data['init']) && !preg_match('/Response$/', $data['name'])) {
                    $result[] = $data;
                }
                $data = array('param' => array(), 'name' => $matches[1]);
            } else {
                if (preg_match('/\\s+([^\\s]+)\\s+([^\\s]+);/', $line, $matches)) {
                    $data['param'][$matches[2]] = $matches[1];
                }
            }
        }
    }
    echo json_encode($result, null, 4);
} catch (Exception $e) {
    echo json_encode(array());
}
開發者ID:CaledoniaProject,項目名稱:web-soap-debugger,代碼行數:31,代碼來源:wsdl.php


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