#12 Specifying an MruHeader will cause a specified AssignmentRul

open
nobody
PHP SForce (3)
5
2007-02-28
2007-02-28
Anonymous
No

The toolkit removes all headers before adding a specific one. Thus, the second call to add the MruHeader removes the previously added AssignmentRuleHeader.

The correct fix would be to generate the SoapHeader objects once and cache within the SForceBaseClient object for reuse. You would then set all headers at once for each call. This would be more efficient as the same objects aren't being created for *every* call.

Alternative quick fix in create/update:

$headers = array();
$headers[] = new SoapHeader($this->namespace, 'SessionHeader', array ('sessionId' => $this->sessionId));

if ($assignment_header != NULL) {
$headers[] = new SoapHeader($this->namespace,
'AssignmentRuleHeader',
array('assignmentRuleId'=>$assignment_header->assignmentRuleId,'useDefaultRule'=>$assignment_header->useDefaultRuleFlag));
}
if ($mru_header != NULL) {
$headers[] = new SoapHeader($this->namespace,'MruHeader',array('updateMru'=>$mru_header->updateMruFlag));
}

$this->sforce->__setSoapHeaders($headers);

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks