Ciao ragazzi, avrei bisogno di una mano sul parser di una risposta soap. Mi potreste dare una mano?
La richiesta è questa:
e poi eseguo le seguenti operazioni:
Ho provato simplexml_load_string ma non funziona.
La richiesta è questa:
Codice:
//Richiesta di accesso
$post_string = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.um.carbon.wso2.org">
<soapenv:Header/>
<soapenv:Body>
<ser:authenticate>
<ser:userName>'.$utente.'</ser:userName>
<ser:credential>'.$pass.'</ser:credential>
</ser:authenticate>
</soapenv:Body>
</soapenv:Envelope>';
e poi eseguo le seguenti operazioni:
Codice:
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);// true per restituire il trasferimento come una stringa del valore restituito di curl_exec al posto di metterlo in output direttamente
curl_setopt($ch, CURLOPT_TIMEOUT, 4);//il numero massimo di secondi per permettere alle funzioni curl di essere eseguite
curl_setopt($ch, CURLOPT_POST, 1); //TRUE per compiere un regolare HTTP POST.
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); //I dati completi da mandare in post in un'operazione HTTP "POST"
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8', 'Content-Length: '.strlen($post_string),'SOAPAction:urn:RemoteUserStoreManagerServiceHttpsSoap11Endpoint','Authorization: Basic YWRtaW46YWRtaW4=' ));
//Un array di campi di header HTTP da impostare
$data = curl_exec($ch); //Risposta 1
Ho provato simplexml_load_string ma non funziona.