Last updated December 28, 2012. Created by amalaer on April 2, 2011.
Edited by chicodasilva. Log in to edit this page.
See README file of the Web service client module.
This is a sample way to call a wsclient Service
$service = wsclient_service_load('your ws service');
$account = new stdClass;
$account->name ='your user';
$account->pass_raw ='your pass';
// for own https certificates
$curl_options[CURLOPT_SSL_VERIFYPEER] = FALSE;
// for own HTTP authorization
$curl_options[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC;
$curl_options[CURLOPT_USERPWD] = $account->name . ':' . $account->pass_raw;
$service->settings['curl options'] = $curl_options;
try {
$result = $service->your_method();
}catch (WSClientException $e) {
watchdog('wsclient', $e->__toString());
return null;
}
return $result;
Comments
Read me = 0 documentation
Sadly the read me provides little documentation on how to create an entity object and send the value to the webservice method.
Perhaps entity_create() ?
Don't know.
Robert Foley Jr
Application Architect / Business Analyst / Information Designer
http://www.robertfoleyjr.com
HTTP authentication examples
Can anyone provide an example with HTTP authentication?