Giter Club home page Giter Club logo

Comments (7)

mtdowling avatar mtdowling commented on May 6, 2024

I just tagged a release of guzzle/command that addresses various issues I encountered while testing command based clients. Can you pull that down and see if it helps?

from guzzle-services.

edi9999 avatar edi9999 commented on May 6, 2024

Hey,

thanks for updating the repository. I still encounter the same issue. Here's the guzzle part of my package.json :

"require": {
    "guzzlehttp/guzzle": "~4.0",
    "guzzlehttp/guzzle-services": "dev-master",
    "guzzlehttp/command": "0.4.0",
}

from guzzle-services.

edi9999 avatar edi9999 commented on May 6, 2024

Hi again,

I have finally solved, but I think this is still an issue.

The problem was that I didn't know that I had to replace the responseClass by responseModel, as it was not documented in the https://github.com/guzzle/guzzle/blob/master/UPGRADING.md .

FurtherMore, the test to see if an operation has a responseModel fails silently:

    $operation = $command->getOperation();
    if (!($modelName = $operation->getResponseModel())) {
        return;
    }

in the ProcessResponse Class

from guzzle-services.

lakiboy avatar lakiboy commented on May 6, 2024

Hey guys! Sorry for jumping in out of nowhere.

@edi9999 if you want a working Guzzle 4 service client example, please take a look at this - https://github.com/dev-machine/guzzle-markus-client

It might be not perfect (as I'm investigating Guzzle 4 myself), but at least you can have a reference at service description and some tests. hth

from guzzle-services.

mtdowling avatar mtdowling commented on May 6, 2024

Yeah, you definitely need to specify responseModel (previously responseClass). I don't see that specified in your provided code which explains why nothing happened. I think it makes sense to convert responseClass attributes to responseModel when constructing an operation so that this works without needing to change an existing description.

As for failing silently, that's intentional; the command event system does not force a specific implementation but just provides a framework for injecting results onto commands. This should be allowed in most implementations of the command package to allow for flexible interoperability with other subscribers (e.g., someone might make a cache subscriber that intercepts commands).

from guzzle-services.

edi9999 avatar edi9999 commented on May 6, 2024

Ok thanks for the explanation, makes sense actually.

@lakiboy thanks a lot too, seems to be doing the same abstract things as I want !

from guzzle-services.

mtdowling avatar mtdowling commented on May 6, 2024

I pushed a change to make sure that responseClass is an alias of responseModel.

from guzzle-services.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.