使用enterprise.wsdl
使用SOAP API在Salesfoce中创建Account时出现问题使用此代码
$mySforceConnection = new SforceEnterpriseClient();
$mySforceConnection -> createConnection("soapclient/enterprise.wsdl.xml");
try {$mySforceConnection -> login(USERNAME, PASSWORD, SECURITY_TOKEN);}
catch (Exception $e) {echo "Connection not possible<br>";}
$record = new stdClass();
$record-> Name = 'test der API';
$record-> Website = 'www.test.de';
$response = $mySforceConnection -> create($record,'Account');
收到错误消息:
Notice: Undefined property: stdClass::$result in xyz on line 499
有人可以为此提供帮助吗?感谢
最佳托马斯
答案 0 :(得分:0)
mySforceConnection-&gt; create()要求第一个参数是记录数组。 将行更改为以下内容为我解决了问题并成功创建了记录:
public static <X, Y, Z> Map<X, Z> join(Map<X, Y> left, Map<Y, Z> right) {
return left.entrySet().stream().collect(
HashMap::new,
(m, e) -> {
//if you still want the mapping k -> null,
//you can just use put directly
Z value = right.get(e.getValue());
if(value != null) m.put(e.getKey(), value);
},
Map::putAll);
}
您可能仍会收到通知,但功能似乎有效。