Using WebService on Wordpress

0

Hello,

I am a trainee for a company, and I am developing a 2-way integration system of BB booths for WordPress, and for that, according to the bank's developer manual, it is necessary for the company to have a database with customer tables and each customer's registered tickets, with the ticket fields saved on this ticket table, etc.

I developed a method using MySQL's own site, to show mvp for the company, however, they use the SQL server, and it will be necessary to integrate this system through a webservice that they will create and they will return an xml file with the data I need from that SQL database of them.

However, I do not understand anything from webservice, I do not know how to use php / wordpress xml to work with the returned data, bridge, etc, I need a light !!

The code for mysql that I used is this:

<?php
        $link = mysqli_connect("hostname", "dbname", "pass", "user");

        if($link === false){
            die("ERROR: Could not connect. " . mysqli_connect_error());
        }

        $sql = "SELECT IDCLIENTE FROM CLIENTE WHERE CPF=".$cpf;
        $result = mysqli_query($link, $sql);
        $row = mysqli_fetch_array($result);
        $id=$row['IDCLIENTE'];
        mysqli_free_result($result);

        $sql = "SELECT * FROM BOLETOS WHERE ID_CLIENTE=".$id;

    if($result = mysqli_query($link, $sql)){

        if(mysqli_num_rows($result) > 0){
            $row = mysqli_fetch_array($result);
            echo "<h2>Pesquisa de Bloquetos</h2>";
            $cedente=$row['CEDENTE'];
            $sacado=$row['SACADO'];
            echo "<h4>Cedente: $cedente</h4>";
            echo "<h4>Sacado: $sacado</h4>";        
            echo "<table>";
                echo "<tr>";
                echo "<th>Nosso Numero</th>";
                echo "<th>Numero Documento</th>";
                echo "<th>Vencimento</th>";
                echo "<th>Valor</th>";
                echo "</tr>";
                echo "<tr>";
                    $nosso_numero=$row['NOSSO_NUMERO'];
                    $num_doc=$row['NUMERO_DOC'];
                    $venc=$row['VENCIMENTO'];
                    $val=$row['VALOR'];
                    $url="https://www63.bb.com.br/portalbb/boleto/boletos/hc21e,802,3322,10343.bbx?nrSacado=".$cpf."&nrNossoNumero=".$nosso_numero;
                    echo "<td><a href='$url' target='_blank'>".$nosso_numero."</a></td>";
                    echo "<td>".$num_doc."</td>";
                    echo "<td>".$venc."</td>";
                    echo "<td>".$val."</td>";
                echo "</tr>";
                while($row = mysqli_fetch_array($result)){      
                    echo "<tr>";
                        $nosso_numero=$row['NOSSO_NUMERO'];
                        $num_doc=$row['NUMERO_DOC'];
                        $venc=$row['VENCIMENTO'];
                        $val=$row['VALOR'];
                        $url="https://www63.bb.com.br/portalbb/boleto/boletos/hc21e,802,3322,10343.bbx?nrSacado=".$cpf."&nrNossoNumero=".$nosso_numero;
                        echo "<td><a href='$url' target='_blank'>".$nosso_numero."</a></td>";
                        echo "<td>".$num_doc."</td>";
                        echo "<td>".$venc."</td>";
                        echo "<td>".$val."</td>";
                    echo "</tr>";
                }
            echo "</table>";
            mysqli_free_result($result);
        }
    }else{
            echo "<h3>Nenhum boleto encontrado.</h3>";
    } 
        mysqli_close($link);
    ?>

Thank you from ja.

    
asked by anonymous 17.08.2018 / 14:22

0 answers