Jump to content

Call to a member function call() on a non-object question


holepro

Recommended Posts

I can call the following function successfully as a single php program

 

  // Acknowledge and clear the orders

  function ack($client, $merchant, $id) {

        $docs = array('string' => $id);

        $params = array('merchant' => $merchant, 'documentIdentifierArray' => $docs);

        $result = $client->call('postDocumentDownloadAck', $params);

        return $result;

        }

with

 

$result = ack($t, $merchant,'2779540483');

 

successful output

 

    [documentDownloadAckProcessingStatus] => _SUCCESSFUL_

    [documentID] => 2779540483

 

I'm trying to figure out how to call this function as an object from another program.

 

Trying the following gives error  ***Call to a member function call() on a non-object***

 

  function postDocumentDownloadAck($t, $merchant, $id) {

    $this->error = null;

    $docs = array('string' => $this->id);

    $params = array('merchant' => $this->merchant, 'documentIdentifierArray' => $docs);

 

**  I've tried the following which does nothing

    $result = $this->soap->call('postDocumentDownloadAck', $params);

 

** I've tried the following  -  which gives error "Call to a member function call() on a non-object"

    $result = $this->t->soap->call('postDocumentDownloadAck', $params);

 

    if($this->soap->fault) {

        $this->error = $result;

        return false;

    }

 

    return $result;

  }

 

 

***

 

calling program snippet for above function

$merchant= array( "merchant"=> $merchantid, "merchantName" => $merchantname, "email"=> $login, "password"=> $password);

$t = new AmazonMerchantAPI($merchantid, $merchantname, $login, $password);

$documentlist= $t->GetAllPendingDocumentInfo('_GET_ORDERS_DATA_');

$docid = $documentlist['MerchantDocumentInfo'][$i]['documentID'];

$docs = array('string' => $docid);

$ackorders = $t->postDocumentDownloadAck($t, $merchant,$docs);

 

Any ideas of what I'm doing wrong are greatly appreciated.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.