2
<?php

define( 'SITELINK_URL', "https://www.smdservers.net/CCWs_3.5/CallCenterWs.asmx?WSDL");
define( 'SITELINK_CORP_CODE', "CCTST" );
define( 'SITELINK_LOC_CODE', "Demo" );
define( 'SITELINK_CORP_LOGIN', "Administrator" );
define( 'SITELINK_CORP_PASS', "Demo" );


$client = new SoapClient( SITELINK_URL );
$params = new stdClass; // as stdClass
$params = array("sCorpCode" => SITELINK_CORP_CODE,"sLocationCode" =>SITELINK_LOC_CODE,"sCorpUserName" => SITELINK_CORP_LOGIN,"sCorpPassword" => SITELINK_CORP_PASS,"First_name" => "Rahul","Last_name" => "Singh");

try
{
$tenant = $client->TenantNew($params);
$tenantResult = $tenant->TenantNewResult->any;
}
catch (Exception $e )
{
    die( 'Error: '.$e->getMessage().'<br>'.$e );
}
  echo htmlentities($tenantResult);

?>

尝试使用上述代码创建一个新租户,但它返回 (-99),这是一个一般异常。我在上面的代码中做错了什么。同样在成功时,我需要使用 ReservationNew 方法进行预订。请帮助解决这个问题。谢谢

4

1 回答 1

1

这是“有效”的代码*。我查看了 WSDL 文件以查看它们用于各种参数的名称,并将“first_name”和“last_name”更改为“sTenantFirstName”和“sTenantLastName”

*通过“工作”我的意思是它给出了看起来更有意义的响应,而不仅仅是一个错误代码

参考:https ://www.smdservers.net/CCWs_3.5/CallCenterWs.asmx?WSDL

<?php

define( 'SITELINK_URL', "https://www.smdservers.net/CCWs_3.5/CallCenterWs.asmx?WSDL"); 
define( 'SITELINK_CORP_CODE', "CCTST" );
define( 'SITELINK_LOC_CODE', "Demo" );
define( 'SITELINK_CORP_LOGIN', "Administrator" );
define( 'SITELINK_CORP_PASS', "Demo" );

$client = new SoapClient( SITELINK_URL );
$params->sCorpCode = SITELINK_CORP_CODE;
$params->sLocationCode = SITELINK_LOC_CODE;
$params->sCorpUserName = SITELINK_CORP_LOGIN;
$params->sCorpPassword = SITELINK_CORP_PASS;
$params->sTenantFirstName = "Rahul";
$params->sTenantLastName = "Singh";

try
{
    $tenant = $client->TenantNew( $params );
    $tenantResult = $tenant->TenantNewResult->any;
}
catch (Exception $e ) {
    die( 'Error: '.$e->getMessage().'<br>'.$e ); 
}

echo htmlentities($tenantResult);  

?>
于 2013-07-10T15:48:09.493 回答