Getting a soap call to this
http://spacedata.agi.com/LunarPhaseWebservice/Service.asmx?op=LunarPhase
<?php
$wsdl = 'http://spacedata.agi.com/LunarPhaseWebservice/Service.asmx?wsdl';
echo '<pre>';
try {
$xConverter = new SoapClient($wsdl);
echo "Types:\n";
if ($xTypes = $xConverter->__getTypes()) {
foreach ($xTypes AS $type) {
echo $type."\n\n";
}
}
echo "Functions:\n";
if ($xTypes = $xConverter->__getFunctions()) {
foreach ($xTypes AS $type) {
echo $type."\n\n";
}
}
} catch (SoapFault $e) {
ar_dump($e);
}
echo '</pre>';
echo '<hr>';
echo '<pre>';
$client = new SoapClient($wsdl);
$client->__call('LunarPhase', array('2010', '8', '25', '1'));
//COMMENTED OUT BELOW-IVE TRIED ALL THESE SLIGHT DIFFERENCES
//$client->__call('LunarPhase', array(2010, 8, 25, 1));
//$client->__call('LunarPhase', array('year' => '2010', 'month' => '8', 'day' => '25', 'TODInMin' => '1'));
//$client->LunarPhase(2010, 8, 25, 1);
/*
$response = $client->LunarPhase('2010', '8', '25', '1');
var_dump($response);
*/
/*
$client = new SoapClient(null, array(
'location' =>'http://spacedata.agi.com/LunarPhaseWebservice/Service.asmx?wsdl',
'uri' =>'http://spacedata.agi.com/LunarPhaseWebservice/',
'style' => SOAP_DOCUMENT,
'use' => SOAP_LITERAL
)
);
$client->__call('LunarPhase', array('year' => '2010', 'month' => '8', 'day' => '25', 'TODInMin' => '1'));
*/
I get the following output
Types:
struct LunarPhase {
int year;
int month;
int day;
int TODInMin;
}
struct LunarPhaseResponse {
double LunarPhaseResult;
}
Functions:
LunarPhaseResponse LunarPhase(LunarPhase $parameters)
LunarPhaseResponse LunarPhase(LunarPhase $parameters)
And the following error
Fatal error: Uncaught SoapFault exception: [soap:Server] Server was unable to process request. ---> Year, Month, and Day parameters describe an un-representable DateTime. in F:\htdocs\SOAP.php:35
Stack trace:
#0 F:\htdocs\SOAP.php(35): SoapClient->__call('LunarPhase', Array)
#1 {main}
thrown in F:\htdocs\SOAP.php on line 35