ID:               46134
 Updated by:       [email protected]
 Reported By:      gsndirectory at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         SOAP related
 Operating System: windows xp
 PHP Version:      5.2CVS-2008-09-20 (snap)
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:
------------------------------------------------------------------------

[2008-09-20 09:53:19] gsndirectory at gmail dot com

Description:
------------
I tried to pull the data using the soap function but always gets a
error message 
Fatal error: SOAP Fault: (faultcode: Sender, faultstring: Allowed
memory
> size of 100663296 bytes exhausted (tried to allocate 16 bytes))

I succeed  to pull the data of 2MB but when tried pulling the data
which is of larger than 35MB it give an error

Reproduce code:
---------------
$client->__setSoapHeaders(array($sforce_header));

$result = $client->__call("GetCurrentDataVer1",array());

htmlspecialchars($client->__getLastRequest(), ENT_QUOTES);

htmlspecialchars($client->__getLastResponse(), ENT_QUOTES);

foreach ($result->GetCurrentDataVer1Result as $val){
        $vars = get_object_vars($val);
        $keys = array_keys($vars);
        $akeys = "a".$keys[0];
        if($keys[0]=="AssetDataCoreFields"){
                $akeys = "aAssetData";
                $tblname = "AssetData";
                }
        else
                $tblname = $keys[0];
        
        $tblname = strtolower($tblname);        
        echo "Inseting Data into ".$tblname."\n";

        foreach ($result->GetCurrentDataVer1Result->$akeys->$keys[0] as
$val1){
                
                $vars1 = get_object_vars($val1);
                $keys1 = array_keys($vars1);
                $count = count($keys1);
                
                $sql = "insert into ".$tblname." (";
                
                for($i=0; $i<$count; $i++){
                        if($count-1 == $i)
                                $sql = $sql.$keys1[$i];
                        else
                                $sql = $sql.$keys1[$i].","; 
                        }
                
                $sql = $sql.") values (";
                
                for($i=0; $i<$count; $i++){
                        if($count-1 == $i) 
                                $sql = $sql."'".$val1->$keys1[$i]."'";
                        else
                                $sql = $sql."'".$val1->$keys1[$i]."',";
                        }       
                
                $sql = $sql.")";
                
                $res = mysql_query($sql) or die(mysql_error());
                }
                if($res)
                        echo "Data Inserted in ".$tblname. "\n";                

        }
  
?> 

Expected result:
----------------
get the data



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46134&edit=1

Reply via email to