What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello all, I am getting this exception inside a client stub: `Spryker\Shared\ZedRequest\Client\Exce
Hello all,
I am getting this exception inside a client stub:Spryker\Shared\ZedRequest\Client\Exception\TransferNotFoundException - Exception: No class name given for Transfer generation.
When I call this function:
public function addAntelopeToQueue(AntelopeTransfer $antelopeTransfer): TransferInterface { return $this->zedRequestClient->call( '/bucket-importer/gateway/add-antelope-to-queue', $antelopeTransfer ); }
Can someone please help?
Comments
-
Do you return a transfer in the gateway controller action?
\Spryker\Shared\ZedRequest\Client\AbstractZedClient::call
assumes that the response from Zed is a transfer.
And in\Spryker\Zed\ZedRequest\Communication\Plugin\GatewayControllerListenerPlugin::getResponse
the return from the controller action is only passed into the response if it is a transfer.
I'm not even sure if it is possible to return null as a result. By looking through all GatewayController actions from Spryker I haven't found any that does not return a transfer.0 -
The gateway controller is returning a
Symfony\Component\HttpFoundation\Response;
object. Something like this:return (new Response())->setContent(json_encode($antelopeTransfer->toArray()));
0 -
And that's wrong. A GatewayController should only return a transfer object, never a Symfony response.
0 -
Instead of
return (new Response())->setContent(json_encode($antelopeTransfer->toArray()));
just doreturn $antelopeTransfer
and you are fine0 -
Thanks, but now I am getting a new error
Spryker\Shared\ZedRequest\Client\Exception\RequestException - Exception: Failed to complete request with server authority <http://backend-gateway.de.spryker.local>. Configured with (SSL Disabled) backend-gateway.de.spryker.local: in /data/config/Shared/config_default.php. Error: Stacktrace: <div style="font-family: Helvetica, Arial, sans-serif; font-size: 14px"><h1>ZED Exception</h1> <div style="background: #dadada; padding: 5px"><font style="12"><b>Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException - The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned an object of type Generated\Shared\Transfer\AntelopeTransfer.</b></font></div> <p>in /data/src/Pyz/Zed/BucketImporter/Communication/Controller/GatewayController.php (37)</p> <p><b>Url:</b>/bucket-importer/gateway/add-antelope-to-queue</p> <p><b>Trace:</b></p> <pre>#0 /data/vendor/symfony/http-kernel/HttpKernel.php(156): () #1 /data/vendor/symfony/http-kernel/HttpKernel.php(78): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #2 /data/vendor/spryker/application/src/Spryker/Shared/Application/Application.php(132): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #3 /data/vendor/spryker/application/src/Spryker/Shared/Application/Application.php(110): Spryker\Shared\Application\Application->handle(Object(Symfony\Component\HttpFoundation\Request)) #4 /data/public/BackendGateway/index.php(20): Spryker\Shared\Application\Application->run() #5 {main}</pre> </div> ...
0 -
Does your controller extends
AbstractGatewayController
?0 -
Wow that was the problem, It was extending
AbstractController
instead. Thank you very much.0 -
You are welcome 😉
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random