Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用php-SOAP的mindbodyapi_Php_Soap - Fatal编程技术网

使用php-SOAP的mindbodyapi

使用php-SOAP的mindbodyapi,php,soap,Php,Soap,一段时间以来,我一直在努力找出这个mindbody API,希望这里有人能找到解决方案。因为我将要在一个客户网站上工作,我需要获得一个激活链接给他们。根据他们的小文档,我需要发送一个带有sourcename、密码和siteid的soapxml请求,它将返回一个包含我所需信息的xml语句。我没有太多使用肥皂,我已经阅读了所有我能在上面找到的东西。下面是我正在尝试的代码(我也尝试过其他代码,包括使用curl)。这是非常基本的,但它是最好的开始 $sourceCredentials = array('

一段时间以来,我一直在努力找出这个mindbody API,希望这里有人能找到解决方案。因为我将要在一个客户网站上工作,我需要获得一个激活链接给他们。根据他们的小文档,我需要发送一个带有sourcename、密码和siteid的soapxml请求,它将返回一个包含我所需信息的xml语句。我没有太多使用肥皂,我已经阅读了所有我能在上面找到的东西。下面是我正在尝试的代码(我也尝试过其他代码,包括使用curl)。这是非常基本的,但它是最好的开始

$sourceCredentials = array('SourceName'=>'mysourcename', 'Password'=>"mypassword", 'SiteIDs'=>array('12345'));
    $client = new SoapClient("https://api.mindbodyonline.com/0_5/SiteService.asmx?WSDL"); 
    $result = $client->__soapCall("GetActivationCode", ($sourceCredentials));  
    echo "<pre>"; print_r($result); echo "</pre>";
$sourceCredentials=array('SourceName'=>'mysourcename','Password'=>'mypassword','SiteIDs'=>array('12345');
$client=新的SoapClient(“https://api.mindbodyonline.com/0_5/SiteService.asmx?WSDL"); 
$result=$client->uu soapCall(“GetActivationCode”,($sourceCredentials));
回声“;打印(结果);回声“;
我经常犯的错误是

System.NullReferenceException:对象引用未设置为对象的实例。位于mb.API.\u 0\u 5.SiteService.GetActivationCode(GetActivationCode请求)

我也尝试过使用Githubs资源,但一直无法找到我需要的


非常感谢您的帮助。

我知道这是一个有点老的问题,但是没有必要手工编写这些请求。MindBody有一个可以找到的PHP API


这不是最好的API,但你必须做你必须做的事。

如果你仍然有问题,我正在写一篇关于它的文章,这里是我创建的,应该可以为你获得激活码。

找到的API示例很可怜。我花了4-5个小时试图找出它们,它们有一堆bug,没有任何注释来帮助更好地理解它们。我的建议是从头开始编写代码。MindBody API文档非常模糊,但它们提供了WSDL URL和方法,这就是您需要知道的全部。如果您对PHP编程和SOAP请求有很好的理解。你需要1-2个小时才能开始

您的SOAP请求未正确设置,请尝试:

    <?php
/**
 * banarsiamin@gmail.com
 * @author Amin KHAN 
 */
/**
 * Provides route responses for the Example module.
 */
ini_set("user_agent", "FOOBAR");
class MINDBODY_API 
{
    /*
    *WSDL Is xml AND NWSDL simple 
    */
    public $appointmentServiceWSDL = "https://api.mindbodyonline.com/0_5/AppointmentService.asmx?WSDL";
    public $appointmentServiceNWSDL = "https://api.mindbodyonline.com/0_5/AppointmentService.asmx";
    public $classServiceWSDL = "https://api.mindbodyonline.com/0_5/ClassService.asmx?WSDL";
    public $classServiceNWSDL = "https://api.mindbodyonline.com/0_5/ClassService.asmx";
    public $clientServiceWSDL = "https://api.mindbodyonline.com/0_5/ClientService.asmx?WSDL";
    public $clientServiceNWSDL = "https://api.mindbodyonline.com/0_5/ClientService.asmx";
    public $dataServiceWSDL = "https://api.mindbodyonline.com/0_5/DataService.asmx?WSDL";
    public $dataServiceNWSDL = "https://api.mindbodyonline.com/0_5/DataService.asmx";
    public $finderServiceWSDL = "https://api.mindbodyonline.com/0_5/FinderService.asmx?WSDL";
    public $finderServiceNWSDL = "https://api.mindbodyonline.com/0_5/FinderService.asmx";
    public $saleServiceWSDL = "https://api.mindbodyonline.com/0_5/SaleService.asmx?WSDL";
    public $saleServiceNWSDL = "https://api.mindbodyonline.com/0_5/SaleService.asmx";
    public $siteServiceWSDL = "https://api.mindbodyonline.com/0_5/SiteService.asmx?WSDL";
    public $siteServiceNWSDL = "https://api.mindbodyonline.com/0_5/SiteService.asmx";
    public $staffServiceWSDL = "https://api.mindbodyonline.com/0_5/StaffService.asmx?WSDL";
    public $staffServiceNWSDL = "https://api.mindbodyonline.com/0_5/StaffService.asmx";

    private $client;
    private $sourceCredentials = array("SourceName"=>'banarsiamin', "Password"=>'123456=', "SiteIDs"=>array('-9999'));
    private $userCredentials = array("Username"=>'Siteowner', "Password"=>'apitest1234', "SiteIDs"=>array('-9999'));

    // CLASS SERVICE //
    function getClasses($params = array()) {
        $this->client = new SoapClient( $this->classServiceWSDL, array("soap_version"=>SOAP_1_1, 'trace'=>true, 
        'exceptions'=>FALSE, "location" => $this->classServiceNWSDL,
       "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {
            $result = $this->client->GetClasses(array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }

    //  GetClassSchedules : - Gets a list of class schedules.  //
    function getClassSchedules($params = array()) {
        $this->client = new SoapClient( $this->classServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->classServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {
            $result = $this->client->GetClassSchedules(array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }


    function getXMLRequest() {
        return $this->client->__getLastRequest();
    }

    function getXMLResponse() {

        return $this->client->__getLastResponse();
    }

    /*************************************
     *  Staff Service
     *  Provides methods and attributes relating to staff.
     *  The following operations are supported. For a formal definition, please review the Service Description.
     **********************************************************************************************************/

    /*
    *   AddOrUpdateStaff :-  Add or update staff.1712 16894
    */
    function addOrUpdateStaff($params = array()) {
        $this->client = new SoapClient($this->staffServiceWSDL, array('soap_version'=>SOAP_1_1, 'Test'=>FALSE, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->staffServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try { 
                $result = $this->client->AddOrUpdateStaff(array("Request"=>$request)); 
        } 
        catch (SoapFault $s) {  echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;} 
        catch (Exception $e) {  echo 'ERROR: ' . $e->getMessage();  }
        return $result;
    }
    /*
    *   GetStaff :-  Gets a list of staff members.
    */
    function getStaff($params = array()) {
        $this->client = new SoapClient($this->staffServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->staffServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try { 
                $result = $this->client->GetStaff(array("Request"=>$request)); 
        } 
        catch (SoapFault $s) {echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;} 
        catch (Exception $e) {  echo 'ERROR: ' . $e->getMessage();  }
        return $result;
    }
    /*  
    *   GetStaffImgURL :- Gets a staff member's image URL if it exists.
    */
    function getStaffImgURL($params = array()) {
        $this->client = new SoapClient($this->staffServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->staffServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try { 
                $result = $this->client->GetStaffImgURL(array("Request"=>$request)); 
        } 
        catch (SoapFault $s) {echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;} 
        catch (Exception $e) {  echo 'ERROR: ' . $e->getMessage();  }
        return $result;
    }
    /*
    *   GetStaffPermissions :- Gets a list of staff permissions based on the given staff member.
    */
    function getStaffPermissions($params = array()) {
        $this->client = new SoapClient($this->staffServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->staffServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try { 
                $result = $this->client->GetStaffPermissions(array("Request"=>$request)); 
        } 
        catch (SoapFault $s) {echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;} 
        catch (Exception $e) {  echo 'ERROR: ' . $e->getMessage();  }
        return $result;
    }
    /*
    *   ValidateStaffLogin :-  Validates a username and password. This method returns the staff on success. 
    */
    function validateStaffLogin($params = array()) {
        $this->client = new SoapClient($this->staffServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->staffServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try { 
                $result = $this->client->ValidateStaffLogin(array("Request"=>$request)); 
        } 
        catch (SoapFault $s) {echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;} 
        catch (Exception $e) {  echo 'ERROR: ' . $e->getMessage();  }
        return $result;
    }

    /**************END STAFF******************/

    /***************************************************/
    /**************Appointments STAFF******************/
    /*************************************************/

    //  GetStaffAppointments :- Gets a list of appointments that a given staff member is instructing. //
    function GetStaffAppointments($params = array()) {
        $this->client = new soapClient( $this->appointmentServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->appointmentServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));

        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);

        try 
        {

            $result = $this->client->GetStaffAppointments(array("Request"=>$request));

        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    //  GetClassSchedules : - Gets a list of class schedules.  //
    function getScheduleItems($params = array()) {
        $this->client = new soapClient( $this->appointmentServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->appointmentServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {
            $result = $this->client->GetScheduleItems(array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    //  GetBookableItems  : - Gets a list of class schedules.     //
    function getBookableItems($params = array()) {
        $this->client = new soapClient( $this->appointmentServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->appointmentServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {  // $client->GetActivationCode(array("Request"=>$request));
            $result = $this->client->GetBookableItems (array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /*AddOrUpdateAppointments  :- Adds or updates a list of appointments.*/
    function addUpdateAppointments($params = array()) {
        $this->client = new soapClient( $this->appointmentServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->appointmentServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {
            $result = $this->client->AddOrUpdateAppointments(array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* AddOrUpdateAvailabilities :- Adds or updates a list of availabilities.*/
    function addUpdateAvailabilities($params = array()) {
        $this->client = new soapClient( $this->appointmentServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->appointmentServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {    
            $result = $this->client->AddOrUpdateAvailabilities(array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /************** END Appointments STAFF******************/

    /************** START Service******************/

    /* AddOrUpdateContactLogs   :- Add or update client contact logs..*/
        function AddOrUpdateContactLogs ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array("soap_version"=>SOAP_1_1,'location'=>$this->clientServiceNWSDL, 'trace'=>true, 'exceptions'=>FALSE, "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->AddOrUpdateContactLogs (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* GetClients :- Gets a list of clients..*/
    function getClients($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        //$result = $client->GetActivationCode(array("Request"=>$request));
        try {
            $result = $this->client->GetClients(array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }

    /* GetClientIndexes  :-Gets a list of currently available client indexes.*/
    function GetClientIndexes ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->GetClientIndexes (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* GetClientPurchases   :-Get purchases for a client.*/
    function GetClientPurchases ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->GetClientPurchases (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* GetClientVisits    :-Get purchases for a client.*/
    function GetClientVisits ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->GetClientVisits (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* GetClientServices     :-Get purchases for a client.*/
    function getClientServices ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->GetClientServices (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* AddOrUpdateClients     :-Get purchases for a client.*/
    function addOrUpdateClients ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->AddOrUpdateClients (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /************** END Service******************/

    /***************************************************/
    /**************Site *******************************/
    /*************************************************/

    //  GetSites :- Gets a list of appointments that a given staff member is instructing. //
    function getSites($params = array()) {
        $this->client = new soapClient( $this->siteServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->siteServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {
            $result = $this->client->GetSites(array("Request"=>$request));

        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }

}
echo "<PRE>";
$mindb              = new MINDBODY_API(); 
$staff          = array('UpdateAction'=>'AddNew',
                    'Clients'=>array( 
                        'Client'=>array(
                        'FirstName'=>'amin',
                        'LastName'=>'khan',
                        'Username'=> 'banarsiamin',
                        'Password'=> 'amin1216$1',
                        'Email'=>'banarsiamin@gmail.com',
                        'MobilePhone'=>'9770534045',
                        'HomePhone'=>'9770534045',
                        'WorkPhone'=>'9770534045',
                        'Address'=>'aminkhanb',
                        'Address2'=>'aminkhanb',
                        'City'=>'aminkhanb',
                        'State'=>'CA',
                        'Country'=>'US',
                        'PostalCode'=>'93401',
                        'ForeignZip'=>'333',
                        'Bio'=>'aminkhanb'
                        )
                    )
                );
    $mail               = 'banarsiamin@gmail.com';
    echo"<BR>";
    //  $addstaff       = $mindb->addOrUpdateClients($staff); // Add Client 
    $result1        = $mindb->getClients(array ('SearchText'=>''));//'SearchText'=>$mail // Get All Cleint
//  print_r($result1);
    $ClientMembers1 = $result1->GetClientsResult;
    //print_r($ClientMembers1);
    $Client1        = $ClientMembers1->Clients;`enter code here`
    //print_r($Client1);
    $getAllClient1  = $Client1->Client;
    print_r($getAllClient1);
?>
'banarsiamin',“Password”=>'123456=',“SiteIDs”=>数组('-9999');
private$userCredentials=array(“用户名”=>“站点所有者”、“密码”=>“APITES1234”、“站点ID”=>array(“-9999”);
//班级服务//
函数getClasses($params=array()){
$this->client=new SoapClient($this->classservicesdl,array(“soap\u version”=>soap\u 1\u 1,'trace'=>true,
“异常”=>FALSE,“位置”=>$this->classServiceNWSDL,
“流上下文”=>流上下文创建(数组('ssl'=>array('verify\u peer'=>false,'allow\u self\u signed'=>false'));
$request=array\u merge(数组(“SourceCredentials”=>$this->SourceCredentials,“UserCredentials”=>$this->UserCredentials),$params);
尝试
{
$result=$this->client->GetClasses(数组(“请求”=>$Request));
}捕获(SoapFault$s){
echo“错误:['.$s->faultcode.].$s->faultstring;
}捕获(例外$e){
回显“错误:”。$e->getMessage();
}
返回$result;
}
//获取类时间表的列表//
函数getClassSchedules($params=array()){
$this->client=new SoapClient($this->classservicewdl,array('soap\u version'=>soap\u 1\u 1,'trace'=>true,'exceptions'=>FALSE,'location'=>this->classServiceNWSDL,
“流上下文”=>流上下文创建(数组('ssl'=>array('verify\u peer'=>false,'allow\u self\u signed'=>false'));
$request=array\u merge(数组(“SourceCredentials”=>$this->SourceCredentials,“UserCredentials”=>$this->UserCredentials),$params);
尝试
{
$result=$this->client->GetClassSchedules(数组(“请求”=>$Request));
}捕获(SoapFault$s){
echo“错误:['.$s->faultcode.].$s->faultstring;
}捕获(例外$e){
回显“错误:”。$e->getMessage();
}
返回$result;
}
函数getXMLRequest(){
返回$this->client->\uuu getLastRequest();
}
函数getXMLResponse(){
返回$this->client->\uuu getLastResponse();
}
/*************************************
*员工服务
*提供与员工相关的方法和属性。
*支持以下操作。有关正式定义,请查看服务描述。
**********************************************************************************************************/
/*
*AddOrUpdateStaff:-添加或更新员工。171216894
*/
函数addOrUpdateStaff($params=array()){
$this->client=new SoapClient($this->staffservicewdl,array('soap\u version'=>soap\u 1\u 1,'Test'=>FALSE,'trace'=>true,'exceptions'=>FALSE,'location'=>$this->staffServiceNWSDL,
“流上下文”=>流上下文创建(数组('ssl'=>array('verify\u peer'=>false,'allow\u self\u signed'=>false'));
$request=array\u merge(数组(“SourceCredentials”=>$this->SourceCredentials,“UserCredentials”=>$this->UserCredentials),$params);
试试{
$result=$this->client->AddOrUpdateStaff(数组(“请求”=>$Request));
} 
catch(SoapFault$s){echo'错误:['.$s->faultcode.]'.$s->faultstring;}
捕获(异常$e){echo'错误:'.$e->getMessage();}
返回$result;
}
/*
*获取工作人员的列表。
*/
函数getStaff($params=array()){
$this->client=new SoapClient($this->staffservicesdl,array('soap\u version'=>soap\u 1\u 1,'trace'=>true,'exceptions'=>FALSE,“location”=>this->staffServiceNWSDL,
“流上下文”=>流上下文创建(数组('ssl'=>array('verify\u peer'=>false,'allow\u self\u signed'=>false'));
$request=array\u merge(数组(“SourceCredentials”=>$this->SourceCredentials,“UserCredential
    <?php
/**
 * banarsiamin@gmail.com
 * @author Amin KHAN 
 */
/**
 * Provides route responses for the Example module.
 */
ini_set("user_agent", "FOOBAR");
class MINDBODY_API 
{
    /*
    *WSDL Is xml AND NWSDL simple 
    */
    public $appointmentServiceWSDL = "https://api.mindbodyonline.com/0_5/AppointmentService.asmx?WSDL";
    public $appointmentServiceNWSDL = "https://api.mindbodyonline.com/0_5/AppointmentService.asmx";
    public $classServiceWSDL = "https://api.mindbodyonline.com/0_5/ClassService.asmx?WSDL";
    public $classServiceNWSDL = "https://api.mindbodyonline.com/0_5/ClassService.asmx";
    public $clientServiceWSDL = "https://api.mindbodyonline.com/0_5/ClientService.asmx?WSDL";
    public $clientServiceNWSDL = "https://api.mindbodyonline.com/0_5/ClientService.asmx";
    public $dataServiceWSDL = "https://api.mindbodyonline.com/0_5/DataService.asmx?WSDL";
    public $dataServiceNWSDL = "https://api.mindbodyonline.com/0_5/DataService.asmx";
    public $finderServiceWSDL = "https://api.mindbodyonline.com/0_5/FinderService.asmx?WSDL";
    public $finderServiceNWSDL = "https://api.mindbodyonline.com/0_5/FinderService.asmx";
    public $saleServiceWSDL = "https://api.mindbodyonline.com/0_5/SaleService.asmx?WSDL";
    public $saleServiceNWSDL = "https://api.mindbodyonline.com/0_5/SaleService.asmx";
    public $siteServiceWSDL = "https://api.mindbodyonline.com/0_5/SiteService.asmx?WSDL";
    public $siteServiceNWSDL = "https://api.mindbodyonline.com/0_5/SiteService.asmx";
    public $staffServiceWSDL = "https://api.mindbodyonline.com/0_5/StaffService.asmx?WSDL";
    public $staffServiceNWSDL = "https://api.mindbodyonline.com/0_5/StaffService.asmx";

    private $client;
    private $sourceCredentials = array("SourceName"=>'banarsiamin', "Password"=>'123456=', "SiteIDs"=>array('-9999'));
    private $userCredentials = array("Username"=>'Siteowner', "Password"=>'apitest1234', "SiteIDs"=>array('-9999'));

    // CLASS SERVICE //
    function getClasses($params = array()) {
        $this->client = new SoapClient( $this->classServiceWSDL, array("soap_version"=>SOAP_1_1, 'trace'=>true, 
        'exceptions'=>FALSE, "location" => $this->classServiceNWSDL,
       "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {
            $result = $this->client->GetClasses(array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }

    //  GetClassSchedules : - Gets a list of class schedules.  //
    function getClassSchedules($params = array()) {
        $this->client = new SoapClient( $this->classServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->classServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {
            $result = $this->client->GetClassSchedules(array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }


    function getXMLRequest() {
        return $this->client->__getLastRequest();
    }

    function getXMLResponse() {

        return $this->client->__getLastResponse();
    }

    /*************************************
     *  Staff Service
     *  Provides methods and attributes relating to staff.
     *  The following operations are supported. For a formal definition, please review the Service Description.
     **********************************************************************************************************/

    /*
    *   AddOrUpdateStaff :-  Add or update staff.1712 16894
    */
    function addOrUpdateStaff($params = array()) {
        $this->client = new SoapClient($this->staffServiceWSDL, array('soap_version'=>SOAP_1_1, 'Test'=>FALSE, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->staffServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try { 
                $result = $this->client->AddOrUpdateStaff(array("Request"=>$request)); 
        } 
        catch (SoapFault $s) {  echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;} 
        catch (Exception $e) {  echo 'ERROR: ' . $e->getMessage();  }
        return $result;
    }
    /*
    *   GetStaff :-  Gets a list of staff members.
    */
    function getStaff($params = array()) {
        $this->client = new SoapClient($this->staffServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->staffServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try { 
                $result = $this->client->GetStaff(array("Request"=>$request)); 
        } 
        catch (SoapFault $s) {echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;} 
        catch (Exception $e) {  echo 'ERROR: ' . $e->getMessage();  }
        return $result;
    }
    /*  
    *   GetStaffImgURL :- Gets a staff member's image URL if it exists.
    */
    function getStaffImgURL($params = array()) {
        $this->client = new SoapClient($this->staffServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->staffServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try { 
                $result = $this->client->GetStaffImgURL(array("Request"=>$request)); 
        } 
        catch (SoapFault $s) {echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;} 
        catch (Exception $e) {  echo 'ERROR: ' . $e->getMessage();  }
        return $result;
    }
    /*
    *   GetStaffPermissions :- Gets a list of staff permissions based on the given staff member.
    */
    function getStaffPermissions($params = array()) {
        $this->client = new SoapClient($this->staffServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->staffServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try { 
                $result = $this->client->GetStaffPermissions(array("Request"=>$request)); 
        } 
        catch (SoapFault $s) {echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;} 
        catch (Exception $e) {  echo 'ERROR: ' . $e->getMessage();  }
        return $result;
    }
    /*
    *   ValidateStaffLogin :-  Validates a username and password. This method returns the staff on success. 
    */
    function validateStaffLogin($params = array()) {
        $this->client = new SoapClient($this->staffServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->staffServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try { 
                $result = $this->client->ValidateStaffLogin(array("Request"=>$request)); 
        } 
        catch (SoapFault $s) {echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;} 
        catch (Exception $e) {  echo 'ERROR: ' . $e->getMessage();  }
        return $result;
    }

    /**************END STAFF******************/

    /***************************************************/
    /**************Appointments STAFF******************/
    /*************************************************/

    //  GetStaffAppointments :- Gets a list of appointments that a given staff member is instructing. //
    function GetStaffAppointments($params = array()) {
        $this->client = new soapClient( $this->appointmentServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->appointmentServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));

        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);

        try 
        {

            $result = $this->client->GetStaffAppointments(array("Request"=>$request));

        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    //  GetClassSchedules : - Gets a list of class schedules.  //
    function getScheduleItems($params = array()) {
        $this->client = new soapClient( $this->appointmentServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->appointmentServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {
            $result = $this->client->GetScheduleItems(array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    //  GetBookableItems  : - Gets a list of class schedules.     //
    function getBookableItems($params = array()) {
        $this->client = new soapClient( $this->appointmentServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->appointmentServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {  // $client->GetActivationCode(array("Request"=>$request));
            $result = $this->client->GetBookableItems (array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /*AddOrUpdateAppointments  :- Adds or updates a list of appointments.*/
    function addUpdateAppointments($params = array()) {
        $this->client = new soapClient( $this->appointmentServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->appointmentServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {
            $result = $this->client->AddOrUpdateAppointments(array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* AddOrUpdateAvailabilities :- Adds or updates a list of availabilities.*/
    function addUpdateAvailabilities($params = array()) {
        $this->client = new soapClient( $this->appointmentServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->appointmentServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {    
            $result = $this->client->AddOrUpdateAvailabilities(array("Request"=>$request));
        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /************** END Appointments STAFF******************/

    /************** START Service******************/

    /* AddOrUpdateContactLogs   :- Add or update client contact logs..*/
        function AddOrUpdateContactLogs ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array("soap_version"=>SOAP_1_1,'location'=>$this->clientServiceNWSDL, 'trace'=>true, 'exceptions'=>FALSE, "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->AddOrUpdateContactLogs (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* GetClients :- Gets a list of clients..*/
    function getClients($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        //$result = $client->GetActivationCode(array("Request"=>$request));
        try {
            $result = $this->client->GetClients(array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }

    /* GetClientIndexes  :-Gets a list of currently available client indexes.*/
    function GetClientIndexes ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->GetClientIndexes (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* GetClientPurchases   :-Get purchases for a client.*/
    function GetClientPurchases ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->GetClientPurchases (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* GetClientVisits    :-Get purchases for a client.*/
    function GetClientVisits ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->GetClientVisits (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* GetClientServices     :-Get purchases for a client.*/
    function getClientServices ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->GetClientServices (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /* AddOrUpdateClients     :-Get purchases for a client.*/
    function addOrUpdateClients ($params = array()) {
        $this->client = new SoapClient($this->clientServiceWSDL, array('soap_version'=>SOAP_1_1, 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->clientServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try {
            $result = $this->client->AddOrUpdateClients (array("Request"=>$request));
        } catch (SoapFault $s) {
            echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
            echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }
    /************** END Service******************/

    /***************************************************/
    /**************Site *******************************/
    /*************************************************/

    //  GetSites :- Gets a list of appointments that a given staff member is instructing. //
    function getSites($params = array()) {
        $this->client = new soapClient( $this->siteServiceWSDL, array("soap_version"=>SOAP_1_1, 'encoding'=>'UTF-8', 'trace'=>true, 'exceptions'=>FALSE, "location" => $this->siteServiceNWSDL,
         "stream_context" => stream_context_create( array( 'ssl' => array('verify_peer'=> false,'allow_self_signed' => FALSE)))));
        $request = array_merge(array("SourceCredentials"=>$this->sourceCredentials, "UserCredentials"=>$this->userCredentials),$params);
        try 
        {
            $result = $this->client->GetSites(array("Request"=>$request));

        } catch (SoapFault $s) {
                echo 'ERROR: [' . $s->faultcode . '] ' . $s->faultstring;
        } catch (Exception $e) {
                echo 'ERROR: ' . $e->getMessage();
        }
        return $result;
    }

}
echo "<PRE>";
$mindb              = new MINDBODY_API(); 
$staff          = array('UpdateAction'=>'AddNew',
                    'Clients'=>array( 
                        'Client'=>array(
                        'FirstName'=>'amin',
                        'LastName'=>'khan',
                        'Username'=> 'banarsiamin',
                        'Password'=> 'amin1216$1',
                        'Email'=>'banarsiamin@gmail.com',
                        'MobilePhone'=>'9770534045',
                        'HomePhone'=>'9770534045',
                        'WorkPhone'=>'9770534045',
                        'Address'=>'aminkhanb',
                        'Address2'=>'aminkhanb',
                        'City'=>'aminkhanb',
                        'State'=>'CA',
                        'Country'=>'US',
                        'PostalCode'=>'93401',
                        'ForeignZip'=>'333',
                        'Bio'=>'aminkhanb'
                        )
                    )
                );
    $mail               = 'banarsiamin@gmail.com';
    echo"<BR>";
    //  $addstaff       = $mindb->addOrUpdateClients($staff); // Add Client 
    $result1        = $mindb->getClients(array ('SearchText'=>''));//'SearchText'=>$mail // Get All Cleint
//  print_r($result1);
    $ClientMembers1 = $result1->GetClientsResult;
    //print_r($ClientMembers1);
    $Client1        = $ClientMembers1->Clients;`enter code here`
    //print_r($Client1);
    $getAllClient1  = $Client1->Client;
    print_r($getAllClient1);
?>