No class name given for transfer generation


#1

Hello everyone. I am trying to connect Yves to Zed using the transfer objects. After creating all that I need, this problem occurs. Due to my lack of knowledge about transfer objects themselves, I don’t understand where is the class name actually assigned. I used the xml file presented in the tutorials. Any help? Here is the error message. Thank you

Spryker\Shared\ZedRequest\Client\Exception\TransferNotFoundException - No class name given for Transfer generation.

in /data/shop/development/current/vendor/spryker/zed-request/src/Spryker/Shared/ZedRequest/Client/AbstractResponse.php (259)

Url: /hello

Trace:

#0 /data/shop/development/current/vendor/spryker/zed-request/src/Spryker/Shared/ZedRequest/Client/AbstractZedClient.php(83): Spryker\Shared\ZedRequest\Client\AbstractResponse->getTransfer() #1 /data/shop/development/current/vendor/spryker/zed-request/src/Spryker/Client/ZedRequest/ZedRequestClient.php(50): Spryker\Shared\ZedRequest\Client\AbstractZedClient->call(’/hello-world/ga…’, Object(Generated\Shared\Transfer\HelloWorldMessageTransfer), NULL) #2 /data/shop/development/current/src/Pyz/Client/HelloWorld/Zed/HelloWorldStub.php(31): Spryker\Client\ZedRequest\ZedRequestClient->call(’/hello-world/ga…’, Object(Generated\Shared\Transfer\HelloWorldMessageTransfer)) #3 /data/shop/development/current/src/Pyz/Client/HelloWorld/HelloWorldClient.php(19): Pyz\Client\HelloWorld\Zed\HelloWorldStub->getSalutationMessage() #4 /data/shop/development/current/src/Pyz/Yves/HelloWorld/Controller/IndexController.php(18): Pyz\Client\HelloWorld\HelloWorldClient->getSalutationMessage() #5 [internal function]: Pyz\Yves\HelloWorld\Controller\IndexController->indexAction() #6 /data/shop/development/current/vendor/symfony/http-kernel/HttpKernel.php(144): call_user_func_array(Array, Array) #7 /data/shop/development/current/vendor/symfony/http-kernel/HttpKernel.php(64): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #8 /data/shop/development/current/vendor/silex/silex/src/Silex/Application.php(586): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #9 /data/shop/development/current/vendor/silex/silex/src/Silex/Application.php(563): Silex\Application->handle(Object(Symfony\Component\HttpFoundation\Request)) #10 /data/shop/development/current/public/Yves/index.php(22): Silex\Application->run() #11 {main}


#2

There’s a doc covering this topic here:
https://documentation.spryker.com/tutorials/advanced/t-transfer-data-yves-zed.htm

Feel free to look it up, and if it doesn’t work for you after, attach the transfer file you have created to the topic and we’ll try to help further.


#3

That’s actually where I got the xml file from.


#4

The file there is only given as an example and it won’t work if you just copy-paste it to your project.


#5

I am trying to make the project from the tutorial work. Seems like something is missing in the xml file itslef, because I generated it without problems


#6

The example xml code will be converted into a proper PHP file just fine.

Looking at the stack trace, there is something wrong in the ZedStub.
Can you please share that class with us (or ideally post a gist with all the code changes)?


#7

the problem in tutorial is:

in final step, src/Pyz/Zed/HelloWorld/Business/MessageGenerator.php should be :

/**
 * @return HelloWorldMessageTransfer
 */
public function generateHelloMessage()
{
    $helloMessages = ["Hello!","Bonjour!","Namaste!","Hallo", "Hola!", "Ciao!"];
    shuffle($helloMessages);

    $transfer = new HelloWorldMessageTransfer();
    $transfer->setValue($helloMessages[0]);
    return $transfer;
}

#8

Thanks a lot. That helped. But now when I look at it, it makes sense. The transfer had to be used somewhere.

lazystar also thank you for your help.