Results 1 to 1 of 1

Thread: Unable to call('login') - How do I find problem?

  1. #1
    mokelly1 is offline Junior Member
    Join Date
    Nov 2010
    Posts
    3

    Default Unable to call('login') - How do I find problem?

    I can log into SugarCRM using 'portal' and '79DnXK' when the portal_only field is 0. I cannot log in with it set to 1.
    Either way I get a false return from $this->soap->call('login'...

    PHP Code:
    function login()
       {
           echo 
    $this->username  "=this->username in login function<br>";
           echo 
    $this->password  "=this->password in login function<br>";

          
    $result $this->soap->call('login', array('user_auth' => array('user_name' => $this->username'password' => md5($this->password), 'version' => '.01'), 'application_name' => 'My Application'));
           
    $this->session $result['id'];
                    echo 
    '<pre>';
    var_dump($result '<br><br>Login -  result<br><br>');
              echo 
    '</pre>';exit;
       } 
    Output from echo statements
    portal=this->username in login function
    79DnXK=this->password in login function

    This is the output from the var_dump()
    bool(false)
    string(31) "

    Login - result

    "


    PHP Code:
    function call($operation$params=array(), $namespace='http://tempuri.org'$soapAction=''$headers=false$rpcParams=null$style='rpc'$use='encoded'){
            
    $this->operation $operation;
            
    $this->fault false;
            
    $this->setError('');
            
    $this->request '';
            
    $this->response '';
            
    $this->responseData '';
            
    $this->faultstring '';
            
    $this->faultcode '';
            
    $this->opData = array();
    echo 
    $operation  "=operation<br>";
    echo 
    $namespace  "=namespace<br>";
    echo 
    $soapAction  "=soapAction<br>";
    echo 
    $headers  "=headers<br>";
              echo 
    '<pre>';
    var_dump($params '<br><br>params <br><br>');
              echo 
    '</pre>';exit; 
    This is the output from call showing the parameters passed.
    login=operation
    http://tempuri.org=namespace
    =soapAction
    =headers

    array(2) {
    ["user_auth"]=>
    array(3) {
    ["user_name"]=>
    string(6) "portal"
    ["password"]=>
    string(32) "17a690ff63361f276c079935059897eb"
    ["version"]=>
    string(3) ".01"
    }
    ["application_name"]=>
    string(14) "My Application"
    }
    string(23) "

    params

    "


    PHP Code:
    echo $payload  "=payload<br>";
            
    // serialize envelope
            
    $soapmsg $this->serializeEnvelope($payload,$this->requestHeaders,$usedNamespaces,$style,$use,$encodingStyle);
            
    $this->debug("endpoint=$this->endpoint, soapAction=$soapAction, namespace=$namespace, style=$style, use=$use, encodingStyle=$encodingStyle");
            
    $this->debug('SOAP message length=' strlen($soapmsg) . ' contents (max 1000 bytes)=' substr($soapmsg01000));
            
    // send
            
    echo $soapmsg  "=soapmsg<br>";
            echo 
    $this->getHTTPBody($soapmsg)  . "=this->getHTTPBody($soapmsg)<br>";
            echo 
    $soapAction  "=soapAction<br>";
            
    $return $this->send($this->getHTTPBody($soapmsg),$soapAction,$this->timeout,$this->response_timeout);
            
                      echo 
    '<pre>';
    var_dump($return '<br><br> return6724<br><br>'); 
    More echo debug output in the call function:
    rpc=style
    encoded=use
    http://tempuri.org=namespace
    portal17a690ff63361f276c079935059897eb.01My Application=payload
    portal17a690ff63361f276c079935059897eb.01My Application=soapmsg
    portal17a690ff63361f276c079935059897eb.01My Application=this->getHTTPBody(portal17a690ff63361f276c079935059897e b.01My Application)
    =soapAction
    http://localhost/components/com_sugarbridgeweberppro/nusoap/nusoap.php=this->endpoint



    bool(false)
    string(27) "

    return6724

    "

    bool(false)
    string(31) "

    Login - result
    login=operation
    http://tempuri.org=namespace
    =soapAction
    =headers

    array(2) {
    ["user_auth"]=>
    array(3) {
    ["user_name"]=>
    string(6) "portal"
    ["password"]=>
    string(32) "17a690ff63361f276c079935059897eb"
    ["version"]=>
    string(3) ".01"
    }
    ["application_name"]=>
    string(14) "My Application"
    }
    string(23) "

    In response() I get the following


    params

    "

    Then from function getResponse()
    PHP Code:
    while (($strlen $content_length) && (!feof($this->fp))) {
                              echo 
    '<pre>';
    var_dump($this->fp '<br><br>this->fp <br><br>');
              echo 
    '</pre>';
                    
    $readlen min(8192$content_length $strlen);
                    
    $tmp fread($this->fp$readlen);
                    echo 
    $tmp  "=tmp<br>";
                    
    $tmplen strlen($tmp);
                    
    $this->debug("read buffer of $tmplen bytes");
                    if ((
    $tmplen == 0) && (!feof($this->fp))) {
                        
    $this->incoming_payload $data;
                        
    $this->debug('socket read of body timed out after length ' strlen($data));
                        
    $this->debug("read before timeout:\n" $data);
                        
    $this->setError('socket read of body timed out');
                        return 
    false;
                    }
                    
    $strlen += $tmplen;
                    
    $data .= $tmp;
                    echo 
    $data  "=data<br>"
    Out put from getResponse()
    resource(100) of type (stream)
    string(25) "

    this->fp

    "
    Not A Valid Entry Point=tmp
    Not A Valid Entry Point=data


    Thanks for your help!
    Last edited by mokelly1; 2010-12-02 at 10:56 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Unable to login
    By sedilson in forum Help
    Replies: 7
    Last Post: 2011-05-17, 01:33 PM
  2. Replies: 2
    Last Post: 2009-02-19, 05:50 PM
  3. Unable to find metadata folder
    By vijay9948 in forum Help
    Replies: 3
    Last Post: 2009-01-15, 02:26 AM
  4. Replies: 0
    Last Post: 2006-05-26, 06:00 PM
  5. Replies: 0
    Last Post: 2006-05-16, 07:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •