writeTimeFile($idfile . "--Registry: Ho trovato {$presoap}"); $body = substr($input, strpos(strtoupper($input), "<" . $presoap . "ENVELOPE")); $ebxml_imbustato_soap_STRING = rtrim(rtrim(substr($body, 0, strpos($body, $boundary)), "\n"), "\r"); writeTmpFiles($ebxml_imbustato_soap_STRING, $idfile . "-ebxml_imbustato_soap-" . $idfile); } ### RIOTTENGO LA STRINGA SOAP } else { $ebxml_imbustato_soap_STRING = $HTTP_RAW_POST_DATA; writeTmpFiles($ebxml_imbustato_soap_STRING, $idfile . "-ebxml_imbustato_soap-" . $idfile); } ## OGGETTO DOM SUL SOAP RICEVUTO: QUI HO IL SOAP CORRETTO! $dom_ebxml_imbustato_soap = domxml_open_mem($ebxml_imbustato_soap_STRING); ##### GESTISCO IL CASO DI DEL PAYLOAD VUOTO $errorcode = array(); include_once 'reg_validation.php'; $isPayloadNotEmpty = controllaPayload($ebxml_imbustato_soap_STRING); if ($isPayloadNotEmpty) { writeTimeFile($idfile . "--Registry: Ho validato il payload"); } ### SE SONO QUA SIGNIFICA CHE IL PAYLOAD RICEVUTO NON E' VUOTO ### ====>>>> POSSO RECUPERARE L'ebXML writeTimeFile($idfile . "--Registry: Inizio ad analizzare il documento"); $root_SOAP_ebXML = $dom_ebxml_imbustato_soap->document_element(); $dom_SOAP_ebXML_node_array = $root_SOAP_ebXML->get_elements_by_tagname("SubmitObjectsRequest"); for ($i = 0; $i < count($dom_SOAP_ebXML_node_array); $i++) { $node = $dom_SOAP_ebXML_node_array[$i]; $ebxml_STRING = $dom_ebxml_imbustato_soap->dump_node($node); } //SCRIVO L'ebXML SBUSTATO if ($clean_cache != "O") { writeTmpFiles($ebxml_STRING, $idfile . "-ebxml-" . $idfile . ".xml");
$input = $HTTP_RAW_POST_DATA; $log->writeLogFile("RECEIVED:", 1); $log->writeLogFile($input, 0); // File da scrivere writeTmpFiles($input, $idfile . "-pre_decode_received-" . $idfile); writeTimeFile($idfile . "--Repository: Scrivo pre_decode_received"); //PASSO A DECODARE IL FILE CREATO // Ottengo il boundary $giveboundary = giveboundary($headers); $boundary = $giveboundary[0]; $MTOM = $giveboundary[1]; include 'rep_validation.php'; ## TEST 11721: CONTROLLO CHE NON SIA the PAYLOAD is not metadata if ($boundary == '') { //boundary non dichiarato --> no payload $isPayloadNotEmpty = controllaPayload($input); } //COMPLETO IL BOUNDARY con due - davanti //$boundary = "--".substr($pre_boundary,0,strlen($pre_boundary)-1); $boundary = "--" . $boundary; //BOUNDARY $log->writeLogFile("BOUNDARY:", 1); $log->writeLogFile($boundary, 0); ###### CASO DI PRESENZA DI ATTACHMENTS if ($boundary != "--") { //////////////////nuovo///////////////////////// #### PRIMA OCCORRENZA DELL'ENVELOPE SOAP if (preg_match('([^\\t\\n\\r\\f\\v";][:]*+ENVELOPE)', strtoupper($input))) { writeTimeFile($idfile . "--Repository: Ho trovato SOAPENV:ENVELOPE"); preg_match('(<([^\\t\\n\\r\\f\\v";<]+:)?(ENVELOPE))', strtoupper($input), $matches); $presoap = $matches[1];