我正在尝试使用 php 来使用这个 web 服务。首先我需要调用 API 方法进行登录。这是我的代码:
try {
$opts = array(
'http' => array(
'user_agent' => 'PHPSoapClient'
)
);
$context = stream_context_create($opts);
$wsdlUrl = 'http://172.20.2.18:1024/ADInterface/services/ModelADService?wsdl';
$soapClientOptions = array(
'stream_context' => $context,
'cache_wsdl' => WSDL_CACHE_NONE);
$checkVatParameters = array(
'user'=>'WebService',
'pass'=>'WebService',
'lang'=>'es_CL',
'ClientID'=>'1000000',
'RoleID'=>'1000014',
'OrgID'=>'1000000',
'WarehouseID'=>'1000001',
'stage'=>'0');
$modelCrud = array(
'serviceType' => 'WSBPartner',
'TableName' => 'XX_WEB_WSBPartner',
'RecordID' => 0,
'Filter' => '',
'Action' => 'Read',
'DataRow' => array(
'field' => array(
'type' => 'integer',
'column' => 'C_BPartner_ID',
'lval' => '',
'disp' => '',
'edit' => '',
'error' => '',
'errorVal' => '',
'val' => 1000643,
)
)
);
$client = new SoapClient($wsdlUrl, $soapClientOptions);
$result = $client->queryData(
'ModelCRUDRequest', array(
'ModelCRUD' => $modelCrud,
'ADLoginRequest' => $checkVatParameters,
)
);
print_r($result);
}
catch(Exception $e) {
echo $e->getMessage();
}
这是错误:参数 ModelCRUDRequest 不存在!
我希望能够调用这些方法,例如queryData
. 我希望我解释得很好,这是我第一次使用网络服务。