Execute API call until desirable response is returned
<p>The process I am creating needs to send data to a soap service. I cannot proceed with my next action until I get a desirable response. </p>

<pre><code>try {
    $return = $soapClient-&gt;__soapCall("BulkLoadContacts",array('parameter' =&gt; $params));

    foreach ($return as $r){
        $upload_id = $r;
    }

    $process_params = array(
        'ProcessID' =&gt; $upload_id,
    );
    $return = $soapClient-&gt;__soapCall("GetProcessStatus",array('parameter' =&gt; $process_params));
    var_dump($return);

}
catch(SoapFault $fault){
    $status = false;
}
</code></pre>

<p>In the above piece of code, I execute the <code>BulkLoadContacts</code> method. I then grab the <code>ProcessID</code> from the response.  Once I have that ID, I then make another call to get the status of the my process. The last dumper tells me the response of <code>GetProcessStatus</code>. The dumper looks like:</p>

<pre><code>object(stdClass)#18 (1) {
  ["WSProcessStatus"]=&gt;
  object(stdClass)#19 (6) {
    ["ProcessID"]=&gt;
    int(3313881)
    ["ListID"]=&gt;
    int(268207)
    ["ProcessName"]=&gt;
    string(20) "listrak_tempfile.txt"
    ["ProcessStartTime"]=&gt;
    string(23) "2012-05-16T14:22:50.643"
    ["ProcessCompleteTime"]=&gt;
    string(22) "2012-05-16T14:22:50.84"
    ["Status"]=&gt;
    string(19) "ProcessingCompleted"
  }
}
</code></pre>

<p>The last item is <code>Status</code>. Only until the method returns with the value of "ProcessingCompleted" do I want to proceed. Any suggestions on how to accomplish this? Would a simple do-while be sufficient?</p>
