I'm new to Services. I followed README.txt . At:
3) Allow anonymous user to access services module from access control
I'm assuming this means access needs to be granted to the specific methods that one wants to call, e.g. node_service's "load node data" permission. Is that correct?
I also followed the directions here: http://drupal.org/node/113699#comment-2306856 . At step 3 below "At this point":
3. Navigate to administer->Site building-> Services and select SOAP - /services/soap to see a beautified represention of the Web Service interfaces
I get a white screen with just the text:
"You must specify a name when you register an operation".
I then tried soap_server_test.php from README.txt, including the correct path to nusoap.php and got the following error:
PHP Fatal error: Call to undefined method soapclient::__soapCall() in .../soap_server_test.php on line 35
Is this a NuSOAP version issue? At admin/build/services/settings/soap I get:
NuSOAP Path: sites/all/modules/soap_server/nusoap/lib/nusoap.php
The location where NuSOAP is installed. This should be a relative path to nusoap.php. Version 0.7.3 found.
soap_server 6.x-1.2-beta1
services 6.x-2.x-dev
NuSOAP 0.7.3
Drupal 6.14
PHP 5.2.11
Thanks in advance for any guidance,
Dave
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | soap_server.patch | 3.53 KB | jherencia |
Comments
Comment #1
davej commentedSome progress: it seems that soap_server-6.x-1.2-beta1 is not compatible with services-6.x-2.x-dev 2009-11-11. In this version of services, the array elements of each service from services_get_all(), called in soap_server(), have keys like 'method', 'args' whereas soap_server-6.x-1.2-beta1 soap_server() expects '#method', '#args'. See the call to services_strip_hashes() in services-6.x-2.x-dev services_get_all().
I uninstalled services-6.x-2.x-dev, installed services-6.x-0.15 and this cured the error "You must specify a name when you register an operation" at services/soap .
soap_server-6.x-1.2-beta1 is the only 6.x version listed at http://drupal.org/project/soap_server so I assume there's currently no version of soap_server compatible with services-6.x-2.x-dev.
I haven't got soap_server_test.php working yet; I replaced $client->__soapCall with $client->__call and this got rid of the error message but I get no results back. Have set permission for anon to "access services" and "load any|own node data".
Dave
Comment #2
ilo commentedDavej, sorry, I just missed the issues from this module (it is the 2nd time it happens to me brbr). I'll work on it, probably would need some assistance during testing.I hope to get this solved ASAP!
Comment #3
davej commentedThanks for the reply, ilo, that's good news. I hope to be using soap_server on a project that is just getting started so I'll be able to do some testing.
Progress with soap_server_test.php: by putting debug statements in the code, e.g.
I found the empty result was due to HTTP Basic Auth being on (d'oh!) but after fixing that I got an error:
PHP Notice: Undefined index: in ...soap_server/nusoap/lib/nusoap.php on line 6497The last debug output was:
That's as far as I've got so far. The same happens with every method call that I've tried: node.load, echo.echo, system.connect, user.login . Here's SOAP-ENV:Body from $client->request:
$client->response consists of (drastically trimmed):
- I.e. the response just has the definitions, with no return value from the specific method that was called.
This is with services-6.x-0.15 and soap_server-6.x-1.2-beta1.
Dave
Comment #4
davej commentedProgress: I found that the problems in getting a response back were due to incorrect/incompatible code in soap_server_test.php . These are the things I changed in that script to get it working:
to:
- 2nd parameter is "bool $wsdl optional, set to true if using WSDL".
Dave
Comment #5
IncrediblyKenzi commentedDave,
Which version of PHP are you using?
If I recall, php 5.2 changed the call to $client->soapCall() to avoid the overloaded use of stdClass's $client->call().
While $client->call() may still be available, it's listed on php's site as deprecated.
-=Aaron
Comment #6
IncrediblyKenzi commentedOop.. nevermind, I just read your post above with version info.
Do you need to use nuSoap in this case? PHP 5.2 should have working soap support out the gate (though I guess it depends on how it was compiled).
PHP's builtin soap client classes are much more performant than nusoap, so use that if you can.
-+Aaron
Comment #7
davej commentedHi Aaron,
Thanks for your post. I'm using nusoap for client testing because I need it anyway as it's required for soap_server. There's a feature request about supporting PHP soap extension: http://drupal.org/node/217958 but this has been postponed.
Changing status back to active - the main issue here is that current soap_server doesn't work with services-6.x-2.x-dev .
Regards,
Dave
Comment #8
ilo commentedActually, I'm making a race to get the PHP soap support merged on current code. I've done other native SOAP projects in the past and have mature code I'm currently putting into.
Sorry for the delay it is taken, if I see difficulties I'd commit things separately.
Comment #9
jherencia commentedThis patch makes SoapServer work with dev release of services module.
Comment #10
ilo commentedjhenjuto, thanks. If someone else could verify this we could make a quick fix committing this path NOW.
Comment #11
davej commentedTested patch #9 with soap_server-6.x-1.2-beta1 and services-6.x-2.x-dev 2009-12-25. This works in my simple test case, however the patch makes soap_server incompatible with services-6.x-0.15, which is the only non-dev release at drupal.org/project/services .
Presumably the removal of hashes in service array elements (e.g. '#method' -> 'method') between services-6.x-0.x and services-6.x-2.x poses a similar compatibility problem for all server modules. How have other server modules dealt with this? Does it make sense to have different versions of soap_server for the different versions of services? Or perhaps better to implement in soap_server the equivalent of function services_strip_hashes and call this if soap_server is talking to services-6.x-0.x ?
Dave
Comment #12
dapperry commentedI come from a .NET background more, but couldnt you use some sort of "reflection" to figure out whether to use # signs or not.
:) David
PS - Current version (with # signs) is incompatible with current stable release of Services (6.X-2.0). You have to remove # signs.
Comment #13
uccio commentedAt this moment Services 6.x-2.4 is stable and this fix work!
Please commit the patch!