notfalsedev / laravel-soap

A soap client wrapper for Laravel
MIT License
634 stars 122 forks source link

Undefined offset: 1 #111

Closed erickpac closed 7 years ago

erickpac commented 7 years ago

Hello, you could help me, I have an error when trying to make a function, I have this code: $params = ['param1' => 'value_1'];

$this->soapWrapper->add('FUNCTION_NAME', function ($service) use ($wsdl) { $service ->wsdl($wsdl) ->trace(true) ->cache(WSDL_CACHE_NONE) ->options(['login' => 'login','password' => 'password']); });

        $response = $this->soapWrapper->call('FUNCTION_NAME', $params);

the error is: Undefined offset: 1

notfalsedev commented 7 years ago

Try:

$params = ['param1' => 'value_1'];

$this->soapWrapper->add('SERVICE_NAME', function ($service) use ($wsdl) {
$service
->wsdl($wsdl)
->trace(true)
->cache(WSDL_CACHE_NONE)
->options(['login' => 'login','password' => 'password']);
});

$response = $this->soapWrapper->call('SERVICE_NAME.FUNCTION_NAME', [$params]);