Currently I'm using php and nusoap and wanted to convert it to Laravel.
When creating the soap calls I use data out of a mysql database.
So I think I would need a model (to get my data) and a controller (to create request).
EDIT:
<?php
namespace App\Http\Controllers;
use Artisaninweb\SoapWrapper\Facades\SoapWrapper;
class SoapController extends Controller {
public function demo()
{
// Add a new service to the wrapper
SoapWrapper::add(function ($service) {
$service
->name('currency')
->wsdl('path/to/wsdl')
->trace(true);
->options(['user' => 'username', 'pass' => 'password']);
});
// Using the added service
SoapWrapper::service('currency', function ($service) {
var_dump($service->getFunctions());
var_dump($service->call('Otherfunction'));
});
}
}
from laravel-soap I couldn't find a tutorial on how to send login parameters prior to any other request. In the example 'using the added service' I see the login credentials but it doesn't work.
This is how I got soap to work in Laravel 5.1
create a controller SoapController.php
Create a route in your routes.php
Route::get('/demo', ['as' => 'demo', 'uses' => 'SoapController@demo']);
If requered you can also use the model extension as described here