Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in example #49

Open
tomasz-kusy opened this issue Feb 20, 2020 · 4 comments
Open

Bug in example #49

tomasz-kusy opened this issue Feb 20, 2020 · 4 comments

Comments

@tomasz-kusy
Copy link

Hi!
I've tried to run example script from readme.md section 'Using the client'. Unsuccessfully. I finally got it started.
I had to change:
$metadata = $container->get('goetas_webservices.soap_client.metadata_reader');
to
$metadata = $container->get('goetas_webservices.soap_client.metadata_loader.array');

It's a bug or?

@goetas goetas added bug and removed bug labels Mar 7, 2020
@goetas
Copy link
Member

goetas commented Mar 7, 2020

@tomasz-kusy
Copy link
Author

I'm not sure but...

user@DESKTOP-UU4MHEL MINGW64 /c/xxx
$ git clone https://github.com/goetas-webservices/soap-client.git
Cloning into 'soap-client'...
remote: Enumerating objects: 28, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (23/23), done.
Receiviremote: Total 987 (delta 9), reused 7 (delta 2), pack-reused 959
Receiving objects: 100% (987/987), 234.07 KiB | 339.00 KiB/s, done.
Resolving deltas: 100% (544/544), done.

$ cd soap-client/
$ composer install
Package operations: 66 installs, 0 updates, 0 removals
(...)
Writing lock file
Generating autoload files

$ php bin/soap-client generate tests/Fixtures/config.yml soap/src/Container --dest-class=TestNs/Container/SoapClientContainer

$ php tests/example.php
PHP Fatal error:  Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The "goetas_webservices.soap_client.metadata_reader" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead. in C:\xxx\soap-client\vendor\symfony\dependency-injection\Container.php:269
Stack trace:
#0 C:\xxx\soap-client\vendor\symfony\dependency-injection\Container.php(225): Symfony\Component\DependencyInjection\Container->make('goetas_webservi...', 1)
#1 C:\xxx\soap-client\tests\example.php(24): Symfony\Component\DependencyInjection\Container->get('goetas_webservi...')
#2 {main}
  thrown in C:\xxx\soap-client\vendor\symfony\dependency-injection\Container.php on line 269

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The "goetas_webservices.soap_client.metadata_reader" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead. in C:\xxx\soap-client\vendor\symfony\dependency-injection\Container.php on line 269

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The "goetas_webservices.soap_client.metadata_reader" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead. in C:\xxx\soap-client\vendor\symfony\dependency-injection\Container.php on line 269

Windows 10

$ php -v
PHP 7.3.7 (cli) (built: Jul  3 2019 14:34:10) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.9.1, Copyright (c) 2002-2020, by Derick Rethans```

@Toilal
Copy link
Contributor

Toilal commented Aug 24, 2020

I hit this issue too, and fixed it with 99940e1.

@Toilal
Copy link
Contributor

Toilal commented Aug 24, 2020

It only occurs when using Symfony 3.4+, because services and aliases are private by default since this version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants