I'm looking for a PHP class that will make it painless to work with a SOAP service. Ideally something that works like this:
$class = new SoapClass();
$class->addArgument('foo', '123');
$class->addArgument('bar', '123');
$class->url('http://ex开发者_高级运维ample.com/services/xyz');
$result = $class->sendRequest();
$data = $result->data;
echo "$data->count results found.";
Any suggestions? I do have PHP 5.
In a word, Nusoap.
http://sourceforge.net/projects/nusoap/
$client = new soapclient('http://somewhere/path/to?wsdl', true);
$result = $client->call('method', [request array structure goes here] );
// -- Process $result
And a handful of examples ...
- http://wiki.reminderconnection.com/index.php?title=PHP_-_using_NuSoap
- http://www.richardkmiller.com/files/msnsearch_nusoap.html
Why don't you use the native php soap client ?
http://php.net/manual/en/class.soapclient.php
Zend is another good alternative ( but you need to have the zend library then )
http://framework.zend.com/manual/en/zend.soap.client.html
My last recommendation is WSO2
http://wso2.com/products/web-services-framework/php/
But soap is not painless so don't expect that. Use a REST architecture.
精彩评论