本文整理汇总了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