开发者

Microsoft CRM 2011 - Entity Id must be specified for Update (PHP)

My CreateContact wsdl method looks like this:

<CreateContact xmlns="">
  <_contactId>string</_contactId>
  <_firstname>string</_firstname>
  <_lastname>string</_lastname>
</CreateContact>

I'm using PHP to create a new contact which works fine:

try {
            $options = array(
                'soap_version'=>SOAP_1_2,
                'exceptions'=>true,
                'trace'=>1,
                'cache_wsdl'=>WSDL_CACHE_NONE
            );
            $client = new SoapClient('', $options);

        } catch (Exception $e) {
            echo $e->getMessage();
        }
 try {
   $response=$client->CreateContact(array(
   '_contactid'=>"",
   开发者_运维百科'_firstname'=>"$_firstname",
   '_lastname'=>"$_lastname"));


}
catch (Exception $e)
{
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}

When I specify an existing "_contactid" (to update a contact), I get: "Entity Id must be specified for Update"?


Sorry I can't add comments yet so have to add it as a possible answer.

Are you passing the guid with {} wrapped around it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜