Authentication_Parameters = $authentication;
$request->OrderCreatorEmail = 'mricois@scores-decisions.com';
$request->CompanyProductIdentifier = $CompanyProductIdentifier;
$request->PartnerData = '';
$firephp->log($request,'requete');
try
{
$placeOrderResult = $graydon->placeOrder($request);
$firephp->log($placeOrderResult,'placeOrder');
}catch( SoapFault $exception ){
// Print the exception
print "\n Exception ";
var_dump($exception->detail);
}
//On vérifie l'état de le demande
if (isset($placeOrderResult) && $placeOrderResult->OrderStatus->OrderState == 'Completed'){
//getCompanyReport
$request = new StdClass();
$request->Authentication_Parameters = $authentication;
$request->LanguageCode = 'E'; //Spécifier la langue du rapport
$request->OrderReference = $placeOrderResult->OrderStatus->OrderReference;
$request->MimeType = 'xml';
$firephp->log($request,'requete');
try
{
$reportResult = $graydon->getCompanyReport($request);
$firephp->log($reportResult,'reportResult');
$xml = $reportResult->ReportXML;
//Enregistrement du fichier xml
$xml = $reportResult->ReportXML->any;
file_put_contents($path.'/'.$fileName, $xml);
}catch( SoapFault $exception ){
// Print the exception
print "\n Exception ";
var_dump($exception->detail);
}
}
//On prend les données du fichier
}else{
$firephp->log('Data depuis fichier XML');
$xml = file_get_contents($path.'/'.$fileName);
}
//========= Affichage des informations =========
if(isset($xml) && $xml!=''){
?>
|
preserveWhiteSpace = false;
$doc->loadxml($xml);
//XPATH Method
$xpath = new DOMXPath($doc);
//Raison sociale
$query = '//GraydonUKCompanySchema/CompanyReportPage/CompanyReport/Company[@Type="Subject"]/Name';
$items = $xpath->query($query);
$tabCompany['RaisonSociale'] = $items->item(0)->nodeValue;
//Date de création de l'entreprise
$query = '//GraydonUKCompanySchema/CompanyReportPage/CompanyReport/Company[@Type="Subject"]/Date[@Type="Age_of_Company"]';
$items = $xpath->query($query);
if ($items->length>0){
foreach ($items->item(0)->attributes as $attrName => $attrNode) {
if($attrName == 'Format'){
}
}
$tabCompany['DateCreation'] = $items->item(0)->nodeValue;
}
//Forme légale
$query = '//GraydonUKCompanySchema/CompanyReportPage/CompanyReport/Legal_Form';
$items = $xpath->query($query);
foreach ($items as $item) {
$tabCompany['FormeLegale'][] = $item->nodeValue;
}
//Adresse
$query = '//GraydonUKCompanySchema/CompanyReportPage/CompanyReport/Address[@Type="Registered"]';
$items = $xpath->query($query);
foreach ($items as $item) {
$tabCompany['AddressRegistered']['EntireAddress'] = $item->getElementsByTagName('EntireAddress')->item(0)->nodeValue;
$tabCompany['AddressRegistered']['Building'] = $item->getElementsByTagName('Building')->item(0)->nodeValue;
$tabCompany['AddressRegistered']['Street'] = $item->getElementsByTagName('Street')->item(0)->nodeValue;
$tabCompany['AddressRegistered']['Street'] = $item->getElementsByTagName('Town')->item(0)->nodeValue;
$tabCompany['AddressRegistered']['City'] = $item->getElementsByTagName('City')->item(0)->nodeValue;
$tabCompany['AddressRegistered']['County'] = $item->getElementsByTagName('County')->item(0)->nodeValue;
$tabCompany['AddressRegistered']['PostCode'] = $item->getElementsByTagName('PostCode')->item(0)->nodeValue;
$tabCompany['AddressRegistered']['Country'] = $item->getElementsByTagName('Country')->item(0)->nodeValue;
}
//Adresse Commerciale
$query = '//GraydonUKCompanySchema/CompanyReportPage/CompanyReport/Address[@Type="Trading"]';
$items = $xpath->query($query);
foreach ($items as $item) {
$tabCompany['AddressTrading']['EntireAddress'] = $item->getElementsByTagName('EntireAddress')->item(0)->nodeValue;
$tabCompany['AddressTrading']['Building'] = $item->getElementsByTagName('Building')->item(0)->nodeValue;
$tabCompany['AddressTrading']['Street'] = $item->getElementsByTagName('Street')->item(0)->nodeValue;
$tabCompany['AddressTrading']['Street'] = $item->getElementsByTagName('Town')->item(0)->nodeValue;
$tabCompany['AddressTrading']['City'] = $item->getElementsByTagName('City')->item(0)->nodeValue;
$tabCompany['AddressTrading']['County'] = $item->getElementsByTagName('County')->item(0)->nodeValue;
$tabCompany['AddressTrading']['PostCode'] = $item->getElementsByTagName('PostCode')->item(0)->nodeValue;
$tabCompany['AddressTrading']['Country'] = $item->getElementsByTagName('Country')->item(0)->nodeValue;
}
//Telephone
$query = '//GraydonUKCompanySchema/CompanyReportPage/CompanyReport/Communication[@Type="Telephone"]';
$items = $xpath->query($query);
foreach ($items as $item) {
$tabCompany['Telephone'][] = $item->nodeValue;
}
//Fax
$query = '//GraydonUKCompanySchema/CompanyReportPage/CompanyReport/Communication[@Type="Fax"]';
$items = $xpath->query($query);
foreach ($items as $item) {
$tabCompany['Fax'][] = $item->nodeValue;
}
$firephp->log($tabCompany, 'tabCompany');
?>
|
|
Aucune information disponible. |