-
-
Notifications
You must be signed in to change notification settings - Fork 27
Clients can now be put in 'raw responses' mode. #14
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
Conversation
…turn Response object instead of responses parsed by the SoapClient class.
|
Thanks for the suggestion! I'm not sure I understand the motivation for this feature though :) Can you give some use-cases on how you're planning to use this? Thanks! |
|
The API I'm using sets session IDs in cookies which I have to retrieve in order to rewrite the webservices URL as such : As far as I know, there is no way to retrieve those cookies from the Client yet. |
…turn Response object instead of responses parsed by the SoapClient class.
…p-react into raw_responses_mode
This sounds like an interesting API you're having to deal with :) I agree that this should be supported somehow. While I'm not a big fan of the initial implementation approach, I do appreciate the discussion! 👍 Personally, I feel that this approach violates SOLID design principles and separation of concerns in particular. Cookies should be accessed on the HTTP level, not on the SOAP level. Otherwise, we may want to look into providing a way to somehow hook into the HTTP lib to get access to the last response object. I'm curious to see what you think 👍 |
|
I agree about SOLID violation. Unfortunately, remembering cookies won't work in my case because the API I'm using works with several distinct webservices. The login service gives me a session ID that I need to add as a parameter in the URLs of other services. Fortunately, I have found another way of dealing with that than using cookies. The session ID is also set in an attribute in the XML response. With PHP's lacking SOAPClient, you cannot access attributes, unless you get the raw XML response that you wrap yourself in a SimpleXMLElement. What I'm about to do now is replace the behavior of this feature. Instead of returning a Response object, it's gonna return the XML as a string, which makes more sense and doesn't break SR principles anymore, I think. What do you think ? |
|
Can you please have a look at the failing tests. It says that FunctionalTest::waitForPromise is undefined, and I don't really understand why :/ |
I'm sorry for having to disappoint here, but I still see this as a major issue 👎 I'm currently looking into clue/reactphp-buzz#16 which will make accessing the request and response objects much simpler. Once that one is resolved, you can probably inject a custom I hope this helps! 👍 |
Allows you to receive the raw Response object instead of just the response as parsed by SoapClient.