How do I pass a munchkin cookie through PHP SOAP call?

Anonymous
Not applicable

How do I pass a munchkin cookie through PHP SOAP call?

I am using the syncLead function and I don't know hwo to pass the munchkin cookie to the Marketo Service to track user usage.

I am converting the script from C# to PHP and in c# I see this

string munchkinCookie = string.Empty;
        if (HttpContext.Current.Request.Cookies["_mkto_trk"] != null)
        {
            munchkinCookie = HttpContext.Current.Request.Cookies["_mkto_trk"].Value;
        }
        ws_lead.marketoCookie = munchkinCookie;
        LeadRec.Email = lead.email;
        ws_lead.leadRecord = LeadRec;
        try
        {
            response = client.syncLead(ws_header, ws_context, ws_lead);
            results = "success";
            rs = response.result;
        }
        catch (Exception e)
        {
            results = e.Message;
            rs = null;
        }


So I thought I could do this in PHP but I haven't had any luck.
 $leadRecord = new stdClass();
      $leadRecord->leadRecord = $leadKey;
      $leadRecord->returnLead = false;
      $leadRecord->marektoCookie = $this->marketoCookie;
      $params = array("paramsSyncLead" => $leadRecord);
 
      //Make request
      $soapClient = new SoapClient($this->marketoSoapEndPoint  ."?WSDL", $this->options);
      try {
        $result = $soapClient->__soapCall('syncLead', $params, $this->options, $this->authHdr);
        if (is_soap_fault($result)) {
            trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR);
        }else{
         # echo 'Success';
        }
      }
      catch(Exception $ex) {
        var_dump($ex);
      }

Tags (1)
1 REPLY 1
Anonymous
Not applicable

Re: How do I pass a munchkin cookie through PHP SOAP call?

*** PLEASE disregard, trash, DELETE!


I made a spelling mistake

$leadRecord->marektoCookie = $this->marketoCookie;

$leadRecord->marketoCookie = $this->marketoCookie;


yup..