<?php
class G {
    function G($cc,$cu,$cp)
    {
        $this->CLIENT_CODE = $cc;
        $this->CLIENT_USERNAME = $cu;
        $this->CLIENT_PASSWORD = $cp;
    }
}
class BIN_SanalPos{
    function BIN_SanalPos()
    {
        $this->BIN = "";
        $this->G = new G(10738, "test" , "test");
    }
}
if($_POST):
    /* Initialize webservice with your WSDL */
    $client = new SoapClient("https://dmzws.ew.com.tr/turkpos.ws/service_turkpos_test.asmx?wsdl");
    $response = $client->BIN_SanalPos(new BIN_SanalPos());
    $q1 = $response->BIN_SanalPosResult;
    $DT_Bilgi = $q1->{'DT_Bilgi'};
    $Sonuc = $q1->{'Sonuc'};
    $Sonuc_Str = $q1->{'Sonuc_Str'};
    $xml = $DT_Bilgi->{'any'};
    $xmlstr = <<<XML
<?xml version='1.0' standalone='yes'?>
<root>
{$xml}
</root>
XML;
    $xmlstr    = str_replace(array("diffgr:","msdata:"),'', $xmlstr);
    $data = simplexml_load_string($xmlstr);
    $liste = $data->diffgram->NewDataSet;
    foreach ($liste->Temp as $oran):
        echo "<br/>";
        echo "MO_01: {$oran->BIN}"."<br/>";
        echo "MO_02: {$oran->SanalPOS_ID}"."<br/>";
        echo "MO_03: {$oran->Kart_Banka}"."<br/>";
        echo "MO_04: {$oran->DKK}"."<br/>";
    endforeach;
endif;
?>
<style>
    .clearfx {
        clear: both;
    }
    .body {
        margin: 0 auto;
        padding: 50px 100px;
    }
    .center-align {
        text-align: center;
        margin: 0 auto;
    }
    .divbox {
        display: inline-block;
    }
    .text-input {
        width: 50%;
    }
    .submit-class {
        width="70%";
        height="30px";
    }
</style>
<form action="binsp.php" method="post" enctype="multipart/form-data" >
    <section role="form" class="section-form">
        <legend class="center-align">
            <h3>BIN_SanalPos Metodu</h3>
        </legend>
        <hr />
        <div class="center-align">
            <input class="Submit" type="submit" name="submit" id="submit" class="submit-class" value="BIN_SanalPos Listele" />
        </div>
    </section>
    <div class="clearfx"></div>
</form>
