肥皂-无法更新。用于识别收件人的密钥为空(执行服务'nms:subscription'的方法'Subscribe'时出错)

时间:2018-12-03 17:47:03

标签: php soap

我正在尝试向用户订阅Adobe Campaign服务,但是即使我对接收方参数进行了硬编码,响应状态也是如此:

"Cannot update. The key used to identified the recipient is empty."

这是我的PHP代码:

    public function subscribe()
    {

        $this->soapSubscribe = new SoapClient(ROOT .'/schemas/subscription.wsdl', array('trace' => 1));

        $xml = <<<EOM
            <recipient _key="email, firstName, [folder-id]" _operation="insertOrUpdate" email="dave@gmail.com" firstName="David" lastName="Smith" company="MyCompany" position="Project Manager" origin="Websitelong" folder-id="7053039">
               <folder _operation="none" name="Folder49"/>
            </recipient>        
EOM;
        $params = array(
            'sessiontoken' => $this->sessionToken,
            'strServiceName' => "New_Service",
            'elemRecipient'=> new SoapVar($xml, XSD_ANYXML),
            'bCreate' => true
        );
        try {
            if ($this->soapSubscribe->Subscribe($params)) {
                return true;
            }
        } catch (SoapFault $fault) {
            var_dump($fault);
            return false;
        }
        return false;
    }

以及SOAP错误响应:

  ["previous":"Exception":private]=>
  NULL
  ["faultstring"]=>
  string(75) "Error while executing the method 'Subscribe' of service 'nms:subscription'."
  ["faultcode"]=>
  string(15) "SOAP-ENV:Server"
  ["detail"]=>
  string(65) "Cannot update. The key used to identified the recipient is empty."

任何人都可以发现可能导致此错误的任何问题吗?

0 个答案:

没有答案