I'm trying to consume a WS via application in laravel 5.6.
This is the test code:
namespace App\Http\Controllers;
use SoapClient;
use Artisaninweb\SoapWrapper\Facades\SoapWrapper;
use Illuminate\Http\Request;
use App\Soap\Request\GetConversionAmount;
use App\Soap\Response\GetConversionAmountResponse;
use App\Soap;
use App\Soap\Response;
class EducacionalController extends Controller{
protected $soapWrapper;
public function index(Request $request){
$soap = SoapWrapper::add(function ($service) {
$service
->name('rmFametro')
->wsdl('http://sistemas.portaledu.com.br:8051/wsConsultaSQL/MEX?wsdl')
->options([
'login' => 'YYYYYYYY',
'password' => 'XXXXXXXX'
])
->trace(true);
});
$response = $soap->soapWrapper->call('RealizarConsultaSQL', [
'codSentenca' => '07',
'codColigada' => '1',
'codSistema' => 'S',
'parameters' => 'CPF=99999999999',
]);
var_dump($response);
}
}
And this is the test error:
Undefined property: Artisaninweb \ SoapWrapper \ Wrapper :: $ soapWrapper
My settings, in aap.php:
'providers' => [
...
Artisaninweb\SoapWrapper\ServiceProvider::class,
...
];
.
'aliases' => [
...
'SoapWrapper' => Artisaninweb\SoapWrapper\Facades\SoapWrapper::class
...
];
Where can not I see an error?