W
W
way_t2017-03-16 11:07:12
Yii
way_t, 2017-03-16 11:07:12

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

2 answer(s)
A
alex stephen, 2017-03-16
@berezuev

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

A
Alexey, 2017-03-16
@masterfreelance

$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 question

Ask a Question

731 491 924 answers to any question