I'm developing an app with Lumen Framework which needs to use SoapClient to communicate with Magaya Software. My app is hosted in Heroku, and has been worked well for few months. 3 days ago I realized that quotations transactions with magaya were failing. I tested the endpoint with postman and I get
'500 Internal Server Error Class SoapClient not found.'
From my localhost is Ok, I can send a quotation without any errors.
magayaApi.php
<?php
namespace App\Services;
use \SoapClient;
class MagayaAPI extends \SoapClient implements MagayaAPIInterface
composer.json
{
"name": "laravel/lumen",
"description": "The Laravel Lumen Framework.",
"keywords": ["framework", "laravel", "lumen"],
"license": "MIT",
"type": "project",
"require": {
"ext-bcmath": "*",
"php": "^7.3|^8.0",
"barryvdh/laravel-dompdf": "^0.9.0",
"laravel/lumen-framework": "^8.0"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"phpunit/phpunit": "^9.3",
"tibonilab/pdf-lumen-bundle": "~2.0.0"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"classmap": [
"tests/"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
]
}
}
Heroku host phpinfo show SoapClient is not active
I tried to add in composer.json
"classmap": [ "soapclient"]
and
"require": {
"ext-soap": "*"
}
Regenerate composer.lock, but obtain same results I found some related posts
- How to use php with soap web service on heroku
- https://salesforce.stackexchange.com/questions/80811/class-not-found-with-php-app-hosted-on-heroku
But I can't solve my problem yet. Any idea?