Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
1) Install all modules including tester module
2) Go to admin/config/services/wsclient/manage/twitter_search/operation/search/test
3) Click execute query.
4) Note error message below:
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /system/ajax
StatusText: OK
ResponseText:
Fatal error: Call to undefined method HttpClient::__getLastRequestHeaders() in /Users/brian-johnalford/Sites/acquia-drupal/sites/all/modules/wsclient/wsclient_tester/wsclient_tester.inc on line 143
Comment | File | Size | Author |
---|---|---|---|
#3 | wsclient-fix-tester-soap-hardcode-1977060.patch | 2.72 KB | thomashuang025 |
Comments
Comment #1
thomashuang025 CreditAttribution: thomashuang025 commentedMaybe the Twitter example is based on restful, but __getLastRequestHeaders() is not the function from HttpClient but SoapClient.
So I simply change the code in wsclient_tester.inc to get request information from other way,and it works for me.. Hope my code could be helpful to u. ^_^
in wsclient_tester.inc
replace
with
Comment #2
klausiYep that seems to be hardcoded to SOAP right now. @thomashuang025 can you provide a proper patch?
Comment #3
thomashuang025 CreditAttribution: thomashuang025 commentedmy first patch..
Comment #4
PatchRanger CreditAttribution: PatchRanger commented@thomashuang025 Congratulations, Huang, your patch works, thanks, it does what it should: it kills the error.
I have some notes though:
+ $args = $args===NULL? array():$args;
Personally I would like to see it as
+ $args = (array) $args;
or even merge it with previous line
- in my view it is neater.
Please re-roll the patch according to coding standards - and maintainers will have greater intention to commit your patch.
I have changed the version, because I confirm that this error occurs in the latest dev too.
Changing the title to clarify the issue: it is not specific bug with Twitter service - it is bug of tester tool.
Comment #5
dman CreditAttribution: dman commentedI too (when I slow down and think about it) would prefer to just go
as it does all that is needed here.
However, I'd had a patch to sort out just the array issue in dev since April
http://drupalcode.org/project/wsclient.git/commit/78b27847ee6cc8c444d112...
It's not fully graceful there either, I think it was just a quick fix at the time.
I do think that it would pay to support REST as well as SOAP though - that was just all I had to test on at the time, and it had not been tried.
I applied this patch - by hand due to the earlier conflict, and because there was the coding standards whitespace to sort out.
But with that done, Yes, it does a good job of working with REST as well as SOAP, so bravo! Thanks for putting the effort in there thomashuang025
In other news, and in the meantime, Twitter has gone and broken that service for us
But at least it shows communication happens.
I'll push this patch into -dev now.
Thanks thomashuang025 !
Comment #7
sam452 CreditAttribution: sam452 as a volunteer commentedIt appears this is still an issue? Both the production version from two years ago, and the more current dev version still will not work with the REST examples, as well as the REST API I'm trying to use it for? What am I overlooking? thx, sam
Comment #8
sam452 CreditAttribution: sam452 as a volunteer commentedIt appears this is still an issue? Both the production version from two years ago, and the more current dev version still will not work with the REST examples, as well as the REST API I'm trying to use it for? What am I overlooking? thx, sam
Comment #9
dman CreditAttribution: dman as a volunteer commentedWhich REST service are you having trouble with?
If you provide a link to a public service endpoint, then it can be looked at. If not, then it's hard to help.
The Twitter example that comes with the module is broken because twitter changed, and so that example should probably be replaced with another open service we can use for testing.
Comment #10
sam452 CreditAttribution: sam452 as a volunteer commentedYes, the Google AJAX example is using REST. Attempting to use the wclient tester on this service returns:
The SOAP examples work fine. But REST is what I need, thx.