Answer the question
In order to leave comments, you need to log in
Why doesn't soap yii2 work?
Good afternoon!
I'm trying to raise a soap server on yii2, I installed subdee/yii2-soap-server.
This is how I try to test:
public function actionTest() {
ini_set('soap.wsdl_cache', 0);
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl',0);
$context = stream_context_create([
'ssl' => [
// set some SSL/TLS specific options
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
]);
$client = new \SoapClient('../modules/soap/wsdl/service.wsdl', [
'trace' => 1,
'stream_context' => $context
]);
try {
header('Content-Type: application/xml');
$res = $client->setDataChange('applyByCar');
var_dump($client->__getLastRequest());
echo '<br>---------<br>';
var_dump($client->__getLastRequestHeaders());
echo '<br>---------<br>';
var_dump($client->__getLastResponse());
echo '<br>---------<br>';
var_dump($client->__getLastResponseHeaders());
echo '<br>---------<br>';
print_r($res);
} catch (SoapFault $e) {
header('Content-Type: text/plain');
echo 'Soap Error' . PHP_EOL;
echo strip_tags($client->__getLastResponse());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:xmethods-delayed-quotes"><SOAP-ENV:Body><ns1:setDataChange><dataName>applyByCar</dataName></ns1:setDataChange></SOAP-ENV:Body></SOAP-ENV:Envelope>
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