} $Document_array = $AllegatiExtrinsicObject[1]; if ($AllegatiExtrinsicObject[0]) { ####SE SONO QUI HO PASSATO IL VINCOLO DI VALIDAZIONE SU DocumentEntryUniqueId $log->writeLogFile('SUPERATO I VINCOLI DI VALIDAZIONE', 1); writeTimeFile($idfile . "--Repository: Ho superato la validazione del messaggio"); } ##### SOLO NEL CASO CHE CI SIANO DOCUMENTI IN ALLEGATO #### TERZA COSA: DEVO VALIDARE XDSDocumentEntry.uniqueId $UniqueId_valid_array = validate_XDSDocumentEntryUniqueId($dom_ebXML, $connessione); if ($UniqueId_valid_array[0]) { writeTimeFile($idfile . "--Repository: XDSDocumentEntryUniqueId valido {$UniqueId_valid_array['0']}"); } //FINE if(!$UniqueId_valid_array[0]) $namespacerim_path = 'urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0'; $namespacerim = givenamescape($namespacerim_path, $ebxml_STRING); $submission_uniqueID = getSubmissionUniqueID($dom_ebXML); $conta_Document_id = count($Document_array); // $ExtrinsicObject_array = $dom_ebXML->get_elements_by_tagname("ExtrinsicObject"); #### CICLO SU TUTTI I FILE ALLEGATI for ($o = 0; $o < $conta_EO; $o++) { #### SINGOLO NODO ExtrinsicObject $ExtrinsicObject_node = $ExtrinsicObject_array[$o]; #### RICAVO ATTRIBUTO id DI ExtrinsicObject $ExtrinsicObject_id_attr = $ExtrinsicObject_node->get_attribute('id'); #### RICAVO ATTRIBUTO mymeType $ExtrinsicObject_mimeType_attr = $ExtrinsicObject_node->get_attribute('mimeType'); #### RICAVO LA RELATIVA ESTENSIONE PER IL FILE $get_extension = "SELECT EXTENSION FROM MIMETYPE WHERE CODE = '{$ExtrinsicObject_mimeType_attr}'"; $res = query_select2($get_extension, $connessione); $file_extension = $res[0][0];
$SOAPED_failure_response = makeSoapedFailureResponse($failure_response, $error_code, $Action, $MessageID); $file_input = $idfile . "-SOAPED_Action_failure.xml"; writeTmpQueryFiles($SOAPED_failure_response, $file_input, true); SendResponseFile($_SESSION['tmpQueryService_path'] . $file_input); exit; } elseif ($Action != "urn:ihe:iti:2007:RegistryStoredQuery") { $failure_response = array("This is a Registry Stored Query transaction and you don't use the Action urn:ihe:iti:2007:RegistryStoredQuery"); $error_code = array("XDSRegistryActionError"); $SOAPED_failure_response = makeSoapedFailureResponse($failure_response, $error_code, $Action, $MessageID); $file_input = $idfile . "-SOAPED_Action_failure.xml"; writeTmpQueryFiles($SOAPED_failure_response, $file_input, true); SendResponseFile($_SESSION['tmpQueryService_path'] . $file_input); exit; } //Ottengo Reply Address $namespacequery = givenamescape('urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0', $ebxml_imbustato_soap_STRING); if ($namespacequery == '') { $inizioAdhocQueryRequest = "<AdhocQueryRequest"; $fineAdhocQueryRequest = "</AdhocQueryRequest>"; $ebxml_STRING = substr($ebxml_imbustato_soap_STRING, strpos($ebxml_imbustato_soap_STRING, $inizioAdhocQueryRequest), strlen($ebxml_imbustato_soap_STRING) - strlen(substr($ebxml_imbustato_soap_STRING, strpos($ebxml_imbustato_soap_STRING, $fineAdhocQueryRequest) + strlen($fineAdhocQueryRequest)))); $ebxml_STRING = str_replace(substr($ebxml_imbustato_soap_STRING, strpos($ebxml_imbustato_soap_STRING, $fineAdhocQueryRequest) + strlen($fineAdhocQueryRequest)), "", $ebxml_STRING); } else { $inizioAdhocQueryRequest = "<{$namespacequery}:AdhocQueryRequest"; $fineAdhocQueryRequest = "</{$namespacequery}:AdhocQueryRequest>"; $ebxml_STRING = substr($ebxml_imbustato_soap_STRING, strpos($ebxml_imbustato_soap_STRING, $inizioAdhocQueryRequest), strlen($ebxml_imbustato_soap_STRING) - strlen(substr($ebxml_imbustato_soap_STRING, strpos($ebxml_imbustato_soap_STRING, $fineAdhocQueryRequest) + strlen($fineAdhocQueryRequest)))); $ebxml_STRING = str_replace(substr($ebxml_imbustato_soap_STRING, strpos($ebxml_imbustato_soap_STRING, $fineAdhocQueryRequest) + strlen($fineAdhocQueryRequest)), "", $ebxml_STRING); } ################################################################################### $error_code = array(); $failure_response = array(); ####### VALIDAZIONE DELL'ebXML SECONDO LO SCHEMA