I am using PHP SDK https://github.com/Rocketeer007/php-dynamics-crm-2011 to connect Dynamics CRM and try to set empty value in lookup field but didn't get success. Following are SOAP request and response data
Request
<?xml version="1.0" encoding="UTF-8"?>
<Update xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<entity>
<b:Attributes xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<b:KeyValuePairOfstringanyType>
<c:key>key name</c:key>
<c:value xmlns:d="http://www.w3.org/2001/XMLSchema" i:type="d:string">Test</c:value>
</b:KeyValuePairOfstringanyType>
<b:KeyValuePairOfstringanyType>
<c:key>Entity Name</c:key>
<c:value i:type="b:EntityReference">
<b:Id i:nil="true" />
<b:LogicalName>Lookup Entity Name</b:LogicalName>
<b:Name i:nil="true" />
</c:value>
</b:KeyValuePairOfstringanyType>
</b:Attributes>
<b:EntityState i:nil="true" />
<b:FormattedValues xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<b:Id>guild</b:Id>
<b:LogicalName>entity name</b:LogicalName>
<b:RelatedEntities xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
</entity>
</Update>
Response
Uncaught SoapFault exception: [Sender] The formatter threw an exception while trying to deserialize the message
what am I doing wrong here?