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


PHP soapclient::setCredentials方法代碼示例

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


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

示例1: isset

 */
require_once '../lib/nusoap.php';
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
echo 'You must set your username and password in the source';
exit;
$username = 'xxxxxx';
$password = 'xxxxxx';
$client = new soapclient("http://staging.mappoint.net/standard-30/mappoint.wsdl", true, $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
$client->setCredentials($username, $password, 'digest');
$view = array('Height' => 200, 'Width' => 300, 'CenterPoint' => array('Latitude' => 40, 'Longitude' => -120));
$myViews[] = new soapval('MapView', 'ViewByHeightWidth', $view, false, 'http://s.mappoint.net/mappoint-30/');
$mapSpec = array('DataSourceName' => "MapPoint.NA", 'Views' => array('MapView' => $myViews));
$map = array('specification' => $mapSpec);
$result = $client->call('GetMap', array('parameters' => $map));
// Check for a fault
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result);
    echo '</pre>';
} else {
    // Check for errors
    $err = $client->getError();
    if ($err) {
        // Display the error
開發者ID:Nemeziz,項目名稱:nusoap-for-php5,代碼行數:31,代碼來源:wsdlclient9.php


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