title: Getting PHP warnings in SOAP response along with success response in PHP
body: <p>When I am testing my SOAP sever, I am getting the PHP warning html message with success response.</p>
  
  <p>The SOAP server is like below:</p>
  
  <pre><code>&lt;?php
  defined('BASEPATH') OR exit('No direct script access allowed');
  ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
  ini_set("allow_url_fopen", "On");
  $server = new SoapServer("../billerwebservice/BillerWS.wsdl"); // WSDL file for function definitions
  $server-&gt;setClass("Payment");
  //$server-&gt;addFunction(array("payAccount","confirmRequest","voidRequest")); // Same func name as in our WSDL XML, and below
  $server-&gt;handle();  
  
  class payAccountResponse {
      public $return;
  }
  
  class confirmResponse {
      public $return;
  }
  
  class voidResponse {
      public $return;
  }
  
  class Payment extends CI_Controller {
  
      /*function __construct(){
          parent::__construct();
          $this-&gt;load-&gt;library("nusoap");     
      }*/
  
  
      public function index(){
  
  
          //url for this page is base_url('api/payment')
          //http://tuition24.net/admin/api/payment
          //this file is in tuition24 server =&gt; /admin/application/controllers/api/Payment.php
  
          //ini_set('display_errors', 0);
  
          /*$l_oServer = new soap_server();
  
          // wsdl generation
          $l_oServer-&gt;debug_flag=false;
          $l_oServer-&gt;configureWSDL('BillerWS', 'http://billerwebservice.co.za');
          $l_oServer-&gt;wsdl-&gt;schemaTargetNamespace = 'http://billerwebservice.co.za';
  
          // add complex type
          $l_oServer-&gt;wsdl-&gt;addComplexType(
              'userData',
              'complexType',
              'struct',
              'all',
              ''
          );
  
          // register method
          $l_oServer-&gt;register('payAccount', array(
              'login' =&gt; 'xsd:string',
              'password'=&gt;'xsd:string',
              'verifyOnly'=&gt;'xsd:boolean',
              'amount'=&gt;'xsd:string',
              'transid'=&gt;'xsd:string'
              ), 
                  array('return'=&gt;'tns:userData'), 
                      'http://billerwebservice.co.za');*/
  
  
  
  
          // pass incoming (posted) data
          //$l_oServer-&gt;service(file_get_contents('php://input')); 
  
      }
  
      public function payAccount ($parameters){
      /*if($verifyOnly){
          if($this-&gt;checklogin($login,$password)){
              return $this-&gt;enquiry($username);
          }else{
  
          }
      }else{*/
      $return_array = new ArrayObject();
  
      $parameters = get_object_vars($parameters); // Pull parameters from SOAP connection
  
      // Sort out the parameters and grab their data
      $loginId = $parameters['LoginID']; 
      $pwd = $parameters['Password'];
      $paymentRefNumber = $parameters['PayRefNo']; 
      $amountDue = $parameters['AmountDue'];
  
      $code = $this-&gt;generatecode($paymentRefNumber,$amountDue); 
      if($this-&gt;checklogin($loginId,$pwd)){
          $params = new StdClass();
          $params-&gt;RespCode = '200';
          $params-&gt;RespDesc = 'Success';
          $params-&gt;Code = $code;
          $params-&gt;PayRefNo =  $paymentRefNumber;
          $currentDateTime = date("y-m-d h:i:s");
  
          //update database
          $this-&gt;db-&gt;insert('payment_transactions',array(
          'datetime'=&gt;$currentDateTime,
          'transactionid'=&gt;$paymentRefNumber,
          'tokennumber'=&gt;$code,
          'status'=&gt;'Success',
          'amount'=&gt;$amountDue
          ));
  
          $response = new payAccountResponse();
          $response-&gt;return = $params;
          return $response;
      }else{
  
      }
      //}
  }
  
      public function confirmRequest($parameters){
      $return_array = new ArrayObject();
  
      $parameters = get_object_vars($parameters); // Pull parameters from SOAP connection
  
      // Sort out the parameters and grab their data
      $loginId = $parameters['LoginID']; 
      $pwd = $parameters['Password'];
      $paymentRefNumber = $parameters['PayRefNo']; 
  
      if($this-&gt;checklogin($loginId,$pwd)){
          $params = new StdClass();
          $params-&gt;messageCode = '200';
          $params-&gt;messageDescription = 'ConfirmOK';
          $currentDateTime = date("y-m-d h:i:s");
  
          $data = $this-&gt;db-&gt;query("select * from payment_transactions where transactionid='$paymentRefNumber'")-&gt;row_array();
          $tokennumber = $data['tokennumber'];
  
          $this-&gt;db-&gt;insert('payment_transactions',array(
          'datetime'=&gt;$currentDateTime,
          'transactionid'=&gt;$paymentRefNumber,
          'tokennumber'=&gt;$tokennumber,
          'status'=&gt;'ConfirmOK',
          'amount'=&gt;$data['amount'],
          ));
  
          //$this-&gt;confirm($paymentRefNumber,$tokennumber,$loginId);
  
          $response = new confirmResponse();
          $response-&gt;return = $params;
          return $response;
      }else{
  
      }
  }
  
      public function voidRequest($parameters){
  
      $return_array = new ArrayObject();
      $parameters = get_object_vars($parameters); // Pull parameters from SOAP connection
  
      // Sort out the parameters and grab their data
      $loginId = $parameters['LoginID']; 
      $pwd = $parameters['Password'];
      $paymentRefNumber = $parameters['PayRefNo']; 
      $currentDateTime = date("y-m-d h:i:s");
  
      $params = new StdClass();
      $params-&gt;messageCode = '200';
      $params-&gt;messageDescription = 'VoidOK';
  
      $data = $this-&gt;db-&gt;query("select * from payment_transactions where transactionid='$paymentRefNumber'")-&gt;row_array();
  
      $this-&gt;db-&gt;insert('payment_transactions',array(
      'datetime'=&gt;$currentDateTime,
      'transactionid'=&gt;$paymentRefNumber,
      'tokennumber'=&gt;$data['tokennumber'],
      'status'=&gt;'VoidOK',
      'amount'=&gt;$data['amount'],
      ));
  
      $this-&gt;cancel($paymentRefNumber);
  
      $response = new voidResponse();
      $response-&gt;return = $params;
      return $response;
  }
  
  
      private function checklogin($username,$password){
          $data = $this-&gt;db-&gt;query("select * from payment_user where username='$username' and password='$password'")-&gt;row_array();
          if($data)
              return true;
          else
              return false;
      }
  
      private function enquiry($username){
          $data = $this-&gt;db-&gt;query("select balance from user where username='$username'")-&gt;row_array();
  
          if($data)
          return $data['balance'];
  
      }
  
      private function generatecode($transid,$amount){
          $r = rand(100000000000,999999999999);
          if(!$this-&gt;db-&gt;insert('code',array('code_no'=&gt;$r,'amount'=&gt;$amount,'transaction_id'=&gt;$transid))){
              return $this-&gt;generatecode($transid,$amount);
          }
          return $r;
      }
  
      private function cancel($transid){
          $this-&gt;db-&gt;delete('code',array('transaction_id'=&gt;$transid));
      }
  
      private function confirm($transid,$card_code,$username){
          $data = $this-&gt;db-&gt;get_where('code',array('code_no'=&gt;$card_code,'transaction_id'=&gt;$transid,'active'=&gt;1))-&gt;row_array();
          if(!$data)
              return false;
          $card_amount = $data['amount'];
          $user_id = $this-&gt;db-&gt;get_where('user',array('username'=&gt;$username))-&gt;row_array()['id'];
          $this-&gt;db-&gt;query("UPDATE user SET balance=balance+$card_amount where username='$username'");
          $this-&gt;db-&gt;insert('transaction',array(
                  'user_id'=&gt;$user_id,
                  'reason'=&gt;'Credited '.$card_amount.' using #'.$card_code,
                  'type'=&gt;3,
                  'amount'=&gt;$card_amount,
                  'params'=&gt;$card_code.' '.$transid
              ));
          $this-&gt;db-&gt;update('code',array('active'=&gt;0),array('code_no'=&gt;$card_code));
          $bal = $this-&gt;db-&gt;get_where('user',array('id'=&gt;$user_id))-&gt;result()[0]-&gt;balance;
          return $bal;
      }
  
  }
  </code></pre>
  
  <p>Please let me know why I am getting these warnings.<a href="https://i.stack.imgur.com/0Tjwf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Tjwf.png" alt="The image attached has error shown"></a>
  The image attached has error shown</p>