NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
how to return array [][]


Joined: 12 Dec 2012
Posts: 7
Location: iran
Reply with quote
hi all

i need the return this array sample >>> Return array1[][]
and i type this function

i can't return the record from database
the colm database is the >>> ID ,FName, LName ,Address,tellphon , age ,.
Code:

function RunScript($DataBaseName,$SqlScript ,$headers){
         $DataBaseName= "=?UTF-8?B?".base64_encode($DataBaseName)."?=";
        $SqlScript = "=?UTF-8?B?".base64_encode($SqlScript )."?=";
        $headers= "=?UTF-8?B?".base64_encode($headers)."?=";

   $conn = new COM ("ADODB.Connection") or die("Cannot start ADO");
   $connStr = "PROVIDER=Microsoft.Ace.OLEDB.12.0;Data Source= \UpdateDB.mdb";
   $conn->open($connStr); //Open the connection to the database
 
     if($conn){
      $arr= array();
      $sql=$SqlScript ;
      $row=odbc_exec($conn, $sql);
      for ($i=0; $i < $num_columns; $i++){
            $arr[$i][0] = $row->Fields(0);
         $arr[$i][1] = $row->Fields(1);
         $arr[$i][2]  =$row->Fields(2);
         $arr[$i][3] = $row->Fields(3);
         $arr[$i][4] = $row->Fields(4);
         $arr[$i][5] = $row->Fields(5);
         $arr[$i][6] = $row->Fields(6);
      }
      return $arr;
     }
  }
     
  odbc_close($conn); 
  //$conn->close();
}


But i dont know best configure WSDL pls hellp me

Code:

$namespace = "http://localhost.com/DMail";
// create a new soap server
$server = new soap_server();
// configure our WSDL
$server->configureWSDL("UpdateService");
$server ->defencoding = 'utf-8';
$server ->soap_defencoding = 'utf-8';
$server ->decode_utf8 = false;
// set our namespace
$server->wsdl->schemaTargetNamespace = $namespace;

$server->wsdl->addComplexType(
    'ArryName',
    'complexType',
    'struct',
    'all',
    '',
    array(
     'eventId'=>array('name'=>'eventId','type'=>'xsd:int'),
     'eventName'=>array('name'=>'eventName','type'=>'xsd:string'))
    );
$server->register(
                // method name:
                'RunScript',       
                // parameter list:
                array('DataBaseName' => 'xsd:string', 'SqlScript' => 'xsd:string', 'headers' => 'xsd:string'),
                // return value(s):
                array('return'=>'tns:ArryName'),
                // namespace:
                $namespace,
                // soapaction: (use default)
                false,
                // style: rpc or document
                'rpc',
                // use: encoded or literal
                'encoded',
                // description: documentation for the method
                'A simple World Mail Sender web method');
               
// Get our posted data if the service is being consumed
// otherwise leave this data blank.               
$POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA'])
                ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';

// pass our posted data (or nothing) to the soap service                   
$server->service($POST_DATA);               
exit();

?>

i know not good this configure WSDL
tanks for all Rolling Eyes
View user's profileFind all posts by armandelta2002Send private message
how to return array [][]
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic