D
D
Dmitry Vasilyuk2014-10-16 18:27:53
PHP
Dmitry Vasilyuk, 2014-10-16 18:27:53

How to get ID from SOAP knowing response XML?

There is an elementary web application. I have worked a bit with SOAP. The simplest client looks like this:

<?php
$string = 'Content-Type: text/html;charset=utf-8';
header($string);
  try {
    // Создание SOAP-клиента
    $client = new SoapClient("http://213.33.168.45:8082/txlife.wsdl");
    
    // Посылка SOAP-запроса c получением результат
              //  print_r($client->__getFunctions());
               // exit;
    $result1 = $client->Ping();
                $result2 = $client->TXLife();
                $result3 = $client->TXLifeTransmittal();
    echo  $result1;
                echo  $result2;
                echo  $result3;
  } catch (SoapFault $exception) {
    echo $exception->getMessage();	
  }
?>

How can I get ConfirmationID among this or what else to get. XML is here:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <TXLife xmlns="http://ACORD.org/Standards/Life/2">
         <TXLifeResponse>
            <TransRefGUID>db0cd81c-940e-4046-ad7a-6e54b55d88e4</TransRefGUID>
            <TransType tc="508">Payment Transaction</TransType>
            <TransExeDate>2014-10-13</TransExeDate>
            <TransExeTime>11:16:49</TransExeTime>
            <TransResult>
               <ResultCode tc="2">Success with Information</ResultCode>
               <ConfirmationID>XZPgLJ7YJnG9Kh5gn4BxUqWffHk%3D</ConfirmationID>
               <ResultInfo>
                  <ResultInfoDesc>TRANSACTION_ID: XZPgLJ7YJnG9Kh5gn4BxUqWffHk=</ResultInfoDesc>
                  <ResultInfoSysMessageCode/>
               </ResultInfo>
            </TransResult>
         </TXLifeResponse>
      </TXLife>
   </soap:Body>
</soap:Envelope>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Chukhlomin, 2015-12-31
@undefine

If the client received xml as a string, then you have to get everything you need using XPath .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question