Answer the question
In order to leave comments, you need to log in
What could be the problem when making a SOAP request?
Good evening everyone. Can you please tell me what could be the problem with this error?
Fatal error: Uncaught SoapFault exception: [Sender] SOAP-ERROR: Encoding: object has no 'ID' property in _soap.php:53
Line 53
I understand that the request must be sent via the SOAP method, but I can't figure out which one. I tried with __soapCall, but I also got an error. I hope someone will not be able to suggest a code example.
-----$result = $this->client->$method($params);
$soap = new soap();
$result = $soap->setRequest('PutInetOrder', $params);
class soap
{
/**
* soap constructor.
*/
public function __construct()
{
ini_set("soap.wsdl_cache_enabled", "0");
ini_set('soap.wsdl_cache_ttl', '0');
ini_set("default_socket_timeout", "1200");
$client = 'http://ссылка/site.1cws?wsdl';
$option = array(
'login' => 'логин',
'soap_version' => SOAP_1_2,
'password' => 'пароль',
'authentication' => SOAP_AUTHENTICATION_BASIC,
'location' => 'http://ссылка/Site.1cws',
'trace' => true,
'exceptions' => 1
);
$this->client = new SoapClient($client, $option);
}
/**
* @param $method
* @param array $params
*
*/
public function setRequest($method, $params = array())
{
if (empty($params)) {
die('Не заполнены параметры');
}
if (empty($method)) {
die('Не указан метод');
}
$result = $this->client->$method($params);
return $result;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question