PERL CODE:
sub getNetOpsComInfoByXngId {
my $xngId = shift;
my $netOpsComStatusCode = 0;
my $netOpsComContactResultsBody;
my $retObj = {};
$retObj->{Error} = '';
my $soap = SOAP::Lite
-> proxy("http://netOpsComWs/NetOpsComService", timeout=>240);
my $serializer = $soap -> serializer();
$serializer->uri('http://svc.example.com/');
$soap->autotype(0);
my @query = (
SOAP::Data->name('xngId' => $xngId));
my $netOpsComContactResults;
eval {
$netOpsComContactResults = $soap->call('getSiteInfoByXngId' => @query);
};
if ($@) {
$retObj->{Error} = "Error encountered while attempting to get netOpsCom info $@";
return $retObj;
} else {
$netOpsComContactResultsBody = $netOpsComContactResults->body;
if ($$netOpsComContactResultsBody{'Fault'}) {
$retObj->{Error} = "Web service fault message,$$netOpsComContactResultsBody{'Fault'}{'faultstring'}";
return $retObj;
}
}
return($netOpsComContactResultsBody);
}
PHP CODE:
ini_set('max_input_time', -1);
$client = new SoapClient("http://netOpsComWs/NetOpsComService?wsdl");
//$result = $client->getSiteInfoByXngId()->opsTrackerSites;
$array = $client->getSiteInfoByXngId()->opsTrackerSites;
//$xngID = $_GET['xngID'];
foreach ($array as $key => $value) {
$array = $value;
$xngID = $_GET['xngID'];
$call = $value->xngId;
if($call > 0){
$xngID = $value;
echo $xngID->managerName;
}
}
but URL doesn’t give me value by xngID.