Slim external http calls

Hi there and first of all thanks for Slim.

Here is my concern.
I’m implementing a front end using Slim. However my data is served by a back end server providing webservices (soap).
What I’m trying to do is call this back end then manipulate the data through slim (as Rest apis).

I can’t find a way to do it.
I’ve tryied imlementing regular php in my controllers but does not work (even no stdClass accessible… then I think there’s no way to instanciate a SoapClient…).

Do you know if there’s a magic package for that or Slim is only designed to work with database through mysqli or eloquent…

This works perfectly fine…

UserService can be a SoapClient or anything else really.


$app->get('/user/{id}', function ($req, $res, $args) {
    $service = $this->get('userService');
    $user = $service->get($args['id']);

    //do things
   return $res->withJson($user);
});

Thanks guy.
Having in mind it must work :wink: I just get my issue.

Basic classes from php seems not to be loaded by default and I had to add ‘use’ for them.
use stdClass;
use SoapClient;

Then it worked perfectly.

Pollux