Using SOAP Client with Laravel Vapor
Hi, I'm building an API to be hosted with Laravel Vapor. The code works on my machine but when I deploy it to Laravel Vapor I get an error where it can't find the WSDL file.
I am using the app_path() helper to get the full path to pass into the SoapClient for the local WSDL file.
$client = new SoapClient(app_path('Services/MyService/Pull.wsdl'), $params);
Initially I was getting a timeout, so I edited the staging.Dockerfile to install php84-soap
FROM laravelphp/vapor:php84
RUN apk --update add libxml2-dev php84-soap
RUN docker-php-ext-install soap
RUN docker-php-ext-enable soap
COPY . /var/task
Then updated the runtime in my vapoy.yml to use docker
environments:
staging:
runtime: docker
This fixed the timeout, but then returned this error message:
SOAP-ERROR: Parsing WSDL: Couldn't load from '/var/task/app/Services/MyService/Pull.wsdl' : failed to load "/var/task/app/Services/MyService/Pull.wsdl": No such file or directory
I am unsure if this is an environment issue or an issue with my code, but like I said, it works fine running it locally using Laravel Sail. Any help appreciated. Thanks.
Please or to participate in this conversation.