/** * Override SOAP_Client::call() to always add our security header * first. */ function &call($method, &$params, $namespace = false, $soapAction = false) { // Create the security header. if (!empty($this->_profile->_subject)) { $this->addHeader($rc = new SOAP_Header('RequesterCredentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Credentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Subject', '', $this->_profile->getSubject())), array('xmlns:ebl' => 'urn:ebay:apis:eBLBaseComponents'))), 1, array('xmlns' => 'urn:ebay:api:PayPalAPI'))); } else { $this->addHeader($rc = new SOAP_Header('RequesterCredentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Credentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Username', '', $this->_profile->getAPIUsername()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Password', '', $this->_profile->getAPIPassword()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Signature', '', $this->_profile->getSignature()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Subject', '', $this->_profile->getSubject())), array('xmlns:ebl' => 'urn:ebay:apis:eBLBaseComponents'))), 1, array('xmlns' => 'urn:ebay:api:PayPalAPI'))); } return parent::call($method, $params, $namespace, $soapAction); }
function &call($method, &$params, $namespace = false, $soapAction = false) { // Create the empty security header if using permissioning, pass the auth token, auth signature, auth timestamp as httpheader if (!empty($this->_profile->_authSignature)) { global $authstringvar; $authstringvar = CallerServices::buildAuthString($this->_profile->_authToken, $this->_profile->_authSignature, $this->_profile->_authTimestamp); $this->addHeader($rc = new SOAP_Header('RequesterCredentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Credentials', 'struct', $tmp, array('xmlns:ebl' => 'urn:ebay:apis:eBLBaseComponents'))), 1, array('xmlns' => 'urn:ebay:api:PayPalAPI'))); } else { $this->addHeader($rc = new SOAP_Header('RequesterCredentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Credentials', 'struct', array(new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Username', '', $this->_profile->getAPIUsername()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Password', '', $this->_profile->getAPIPassword()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Signature', '', $this->_profile->getSignature()), new SOAP_Value('{urn:ebay:apis:eBLBaseComponents}Subject', '', $this->_profile->getSubject())), array('xmlns:ebl' => 'urn:ebay:apis:eBLBaseComponents'))), 1, array('xmlns' => 'urn:ebay:api:PayPalAPI'))); } return parent::call($method, $params, $namespace, $soapAction); }