PBAs SDK Login

Discussion in 'Troubleshooting' started by Linh Ho, Sep 23, 2014.

  1. Linh Ho

    Linh Ho Kilo Poster

    Messages:
    28
    Hi everyone,

    I use PBAs SDK to develop webshop that using PBAs method.
    But it always returns FALSE.

    I configured on frontend as below.

    Code:
    <Location /hspc/xml-api>
     Order Deny,Allow
    Allow from all
    </Location>
    
    My code as below.
    Code:
    require_once('lib/nusoap.php');
    
    
        function tryAuth() {
            // Admin user account with API Access
            $adminuser = 'adminusername';
            $adminpass = 'adminpassword';
            // Domain where PBAS lives.
            $domain = '192.168.180.231';
            $url = 'https://' . $domain . '/hspc/xml-api';
            var_dump($url);
            $client = new nusoap_client($url);
            $result = $client->call('session_open', array(array('email' => $adminuser, 'password' => $adminpass)), 'HSPC/API/1.0');
            $sid = $result['session_id'];       
            var_dump($result);       
        }
    
         tryAuth() ;
    
       
    I hope someone can help me :( Do i need enable some security or something else ?
     
  2. FedorK

    FedorK Mega Poster

    Messages:
    224
    Hello,

    Please check that you enable API in correct file you should change /etc/hspcd/conf/hspc_ssl.conf not /etc/hspcd/conf/hspc_frontend.conf
    After change this file you should restart httpd.

    If error still exist try to fix nusoap:
    --- nusoap.php.orig 2014-08-21 14:18:55.000000000 +0400
    +++ nusoap.php 2014-08-21 14:20:08.000000000 +0400
    @@ -2849,6 +2849,9 @@
    $this->setHeader('Content-Length', strlen($data));
    }



    + // disable "Expect" header (disable chunked transfer encoding)
    + $this->outgoing_headers['Expect'] = '';
    +
    // start building outgoing payload:
    if ($this->proxy) {
    $uri = $this->url;

    If still error exist please try use native SOAP support in PHP 5 (SoapClient).
     
  3. Linh Ho

    Linh Ho Kilo Poster

    Messages:
    28
    Thanks,

    I fixed this issue
     

Share This Page