Closed ch1986 closed 6 years ago
@ch1986 could you provide your configuration of clients, please?
Hi, sure.
#config.yml
eight_points_guzzle:
logging: true
clients:
production_trading_api:
base_url: "%ebay_production_trading_api_url%"
sandbox_trading_api:
base_url: "%ebay_sandbox_trading_api_url%"
production_policies_api:
base_url: "%ebay_production_policies_api_url%"
sandbox_policies_api:
base_url: "%ebay_sandbox_policies_api_url%"
plesk_api:
base_url: "%plesk_api_url%"
#parameters.yml
ebay_production_trading_api_url: 'https://api.ebay.com'
ebay_production_policies_api_url: 'https://svcs.ebay.com'
ebay_sandbox_trading_api_url: 'https://api.sandbox.ebay.com'
ebay_sandbox_policies_api_url: 'https://svcs.sandbox.ebay.com'
plesk_api_url: 'https://51.140.186.85:8443'
Thanks
@ch1986 I tested and it seems to be ok. I checked it from controller and from console command too and in dev and prod environments. Could you please try to clear cache for all environments and write here the result?
@ch1986 I see there are all middlewares defined except request_time middleware. Probably you updated guzzle bundle and didn't clear cache.
Hi, I have cleared cache and problem persists. I don't understand why error says "eight_points_guzzle.middleware.request_time.production_trading_api" when the client is named "eight_points_guzzle.client.production_trading_api". Thanks
@ch1986 each client has related services. In your case client is dependent on request_time
middleware that is defined internally and used internally too. Somehow this service was not defined. Please try next steps:
vendor/eightpoints/guzzle-bundle/src/DependencyInjection/EightPointsGuzzleExtension.php
$requestTimeMiddlewareDefinition->setPublic(false);
and replace it by $requestTimeMiddlewareDefinition->setPublic(true);
- public became true, not false. It's the only difference between this middleware and other, that are defined.And one more possibility. If the project is not private and you have possibility to share with me your code then you can zip the project and to send me by email (it's written on my profile page).
Hi, I follow the steps and the result is
[LogicException] Unable to register extension "Twig_Extension_Debug" as it is already registered.
Thanks
@ch1986 I did an PR #166 with fix. Please run composer update eightpoints/guzzle-bundle
to get latest version, clear cache and try one again. Thanks for your patience and help.
Hi, it works. Thank you so much
@ch1986 Fine. I'm glad to see that it's ok now :slightly_smiling_face: thank you for reporting the problem and patience!
@ch1986 could you write please which version of symfony do you use?
Hi, Symfony version 3.1.10 PHP version 7.1 Best regards
Released in v7.3.0 (https://github.com/8p/EightPointsGuzzleBundle/releases/tag/7.3.0)
Hi, when I try to use the guzzle client from a command I get an error associated with the name. For example,
CODE
$client = $this->getContainer()->get('eight_points_guzzle.client.production_trading_api');
ERROR You have requested a non-existent service "eight_points_guzzle.middleware.request_time.production_trading_api". Did you mean one of these: "eight_points_guzzle.client.production_trading_api", "eight_points_guzzle.middleware.event_dispatch.production_policies_api", "eight_points_guzzle.middleware.event_dispatch.production_trading_api", "eight_points_guzzle.middleware.event_dispatch.sandbox_trading_api", "eight_points_guzzle.middleware.log.production_policies_api", "eight_points_guzzle.middleware.log.production_trading_api", "eight_points_guzzle.middleware.log.sandbox_trading_api"?
However, when I use the guzzle client from a controller it works fine. Could you please help me? Thanks