Answer the question
In order to leave comments, you need to log in
How to pass a string (as a parameter) via SOAP protocol to a server (PHP)?
I am creating a payment system emulator on YII2.
I cannot pass a string through the __soapCall() method. Any ideas how to implement string passing? You need to pass a string, since the methods on the server accept only one as a parameter.
Answer the question
In order to leave comments, you need to log in
It's not very clear what exactly you want. "I need to pass a string, but the method only accepts a string"... I
will assume that you need to pass a different data type.. Then serialize will help you
$options = [
'login' => 'log',
'password' => 'pas',
'trace' => 1,
];
$client = new SoapClient('https://exaple/', $options);
$ap_param = array('transaction' => '1', 'data' => ['amount' => 10000, 'card_number' => '4276520014752410']);
$info = $client->__soapCall('pay', json_encode($ap_param));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question