Ich verwende PHP, um eine Verbindung zu einem Dynamics 2011 IFD herzustellen und erfolgreich Kontakte zu meiner Webanwendung zu authentifizieren und abzurufen.Dynamics 2011 (IFD) CRM SOAP-Update funktioniert nicht
Ich bin jedoch bemüht, einen Kontakt zu aktualisieren.
Meine SOAP-Anfrage (unten) gibt 'Bad Request' zurück und leider habe ich keinen ausreichenden Admin-Zugriff auf den Server, um nützlichere Fehlermeldungen zu ermöglichen. Kann irgendjemand etwas in diesem XML offensichtlich finden, das das Problem sein kann?
$request = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
'.$this->crmAuth->GetSoapHeaderOnPremise("Update").'
<s:Body>
<Update xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<entity xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts">
<a:Attributes xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<a:KeyValuePairOfstringanyType>
<b:key>contactid</b:key>
<b:value i:type="c:guid" xmlns:c="http://schemas.microsoft.com/2003/10/Serialization/">'.$contactid.'</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>firstname</b:key>
<b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">'.$firstname.'</b:value>
</a:KeyValuePairOfstringanyType>
<a:KeyValuePairOfstringanyType>
<b:key>lastname</b:key>
<b:value i:type="c:string" xmlns:c="http://www.w3.org/2001/XMLSchema">'.$lastname.'</b:value>
</a:KeyValuePairOfstringanyType>
</a:Attributes>
<a:EntityState i:nil="true" />
<a:FormattedValues xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<a:Id>'.$contactid.'</a:Id>
<a:LogicalName>contact</a:LogicalName>
<a:RelatedEntities xmlns:b="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
</entity>
</Update>
</s:Body>
</s:Envelope>'
Die 'getSoapHeaderOnPremise' Funktion zurückkehrt auth Arbeits Header für die abrufen/retrieveMultiple Anfragen. Der einzige Unterschied ist die Update-Methode wird angegeben:
<a:Action s:mustUnderstand="1">http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Update</a:Action>
Vielen Dank für die Antwort - leider machte es aber keinen Unterschied. Guter Vorschlag. Bin dankbar. – steve