0 Replies Latest reply on Aug 19, 2012 9:22 PM by iamcootis

    Service 'Test Operation' returns value, but service within application does not

    iamcootis Level 1

      I have a service written in PHP. When I right-click on the service and do a test operation and pass a value, it returns the correct object. When I try to do the same service call within my application, it returns a object with all null values. What  could I be doing wrong?

       

      Here is my php code:

      public function getUserByFacebookId($fb){
              $stmt = mysqli_prepare($this->connection,
                "SELECT id, fb_id, name, birthday, firstName, gender, hometown, lastName, location, username, link,
                    weight, targetWeight, weeksTraining, height, startDate, endDate, orientationDate,
                    age FROM users WHERE fb_id = ?" );     
               
            $this->throwExceptionOnError();
            
            mysqli_bind_param($stmt, 'i', $fb);
            $this->throwExceptionOnError();
            
            mysqli_stmt_execute($stmt);
            $this->throwExceptionOnError();
            
            $rows = array();
            mysqli_stmt_bind_result($stmt, $row->id,$row->fb_id,$row->name,$row->birthday,$row->firstName,$row->gender,
                    $row->hometown,$row->lastName,$row->location,$row->username,$row->link,$row->weight,$row->targetWeight,
                    $row->weeksTraining,$row->height,$row->startDate,$row->endDate,$row->orientationDate,$row->age);
      
            while (mysqli_stmt_fetch($stmt)) {
                $rows[] = $row;
                $row = new stdClass();
                mysqli_stmt_bind_result($stmt, $row->id,$row->fb_id,$row->name,$row->birthday,$row->firstName,$row->gender,
                    $row->hometown,$row->lastName,$row->location,$row->username,$row->link,$row->weight,$row->targetWeight,
                    $row->weeksTraining,$row->height,$row->startDate,$row->endDate,$row->orientationDate,$row->age);
      
            }
            
            mysqli_stmt_free_result($stmt);
            mysqli_close($this->connection);
      
            return $rows;
          }
      

       

      Why would it work when I do the test operation and not in the actual application if I'm passing the same value?