-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Added the possibility to override the webservice location #7
Conversation
…e to load the WSDL from one place and to query a server that is different from the one specified in the WSDL
Awesome, the feature looks great and is very much appreciated! 👍 I understand this could be a bit cumbersome, but have you tried looking into adding a test? :-) I also like the immutable interface. Should we take #5 into account here? |
I will add the test now while working on another feature I need to make your library work in my project, don't worry. I don't understand what you mean by "take #5" into account, though. My commit doesn't address this. If there is something I can do to help, let me know ! To satisfy the needs of our customer, I need to be able to get the location in the WSDL, append a URL parameter to it and use the overrideLocation() method to send queries to that new location. SoapClient makes it impossible to retrieve the location stored in the WSDL. To get it, I'd have to resort to using a hack. I have several solutions, but they're all hackish. The best I found is this one :
I need that feature. I know it's hackish. As far as I know, the alternatives are no better. My questions are :
|
- Added tests for the location override feature
I've pushed tests. Not optimal, but they work ! |
Awesome! :-)
Indeed, this isn't directly related. I was more referring to how PHP's normal
Now this is a very interesting hack :-D
Have you looked into using the
|
Well done sir. It seems to work. I should be reading docs more ! UPDATE : No, it doesn't. It returns what you set during the previous setLocation call :( |
$copy = clone $this; | ||
$this->locationOverride = $newLocation; | ||
return $copy; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHP's SoapClient already offers a __setLocation()
method, perhaps we can rely on this there instead of manually keeping track of the location? (see also above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it, it does not work :(
- Test for the location getter
- Renamed overrideTarget to withOverridenTarget() everywhere
OK. This new feature should be implemented with the future in mind. If I rename withOverridenTarget to withTarget, which I will do in a minute, you'll be able to offer the same interface to your users when #5 is implemented, while adding more functions. Is it OK for you ? |
…as passed a reference
150c78c
to
2dfeb4c
Compare
Indeed :) Initially, this ticket was about only overriding the location setting. This is now about accessing the location setting, so I'd rather like to keep this separate. See #13 for more details.
Looks good so far :) May I ask you to remove the other changes related to accessing the location so that we can ease the review? Thanks! |
I've read all your comments. I'll make the changes soon |
Done ! (Tests fails for the same unknown reason as for PR #14) |
The changes LGTM and I'd love to get this in |
Conflicts: README.md src/Client.php
Conflicts: README.md src/Client.php
Done! |
Is there a timeline for v0.3.0? I need this feature. :-) |
This currently has a merge conflict and there are currently no immediate plans to build this from my end (no demand at the moment and more important outstanding issues currently), but I would be really happy to accept any help with this 👍 (If you need this for a commercial project and you want a quote, please check out my profile and send me an email) :-) |
I resolved the merge conflict and cleaned up the code a bit. See #23. Would be great to have v0.3.0 including this. |
@floriansimon1 Thank you for your patience and thank you for working on this! I've recently started working on this project again and I agree that it makes sense to have this feature. I see that @pascal-hofmann has picked up your work and added some tests for this in #23, so I will close this PR for now and I will get back to the other PR as soon as time permits 👍 |
Allows one to load the WSDL from one place and to query a server that is different from the one specified in the WSDL