Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Php soap end point request to microsoft dynmaic crm

$
0
0

Hello all,

I have following problem when create soap request to microsoft dynamic crm using php:

my code:

$xml = "<s:Body>";
$xml .= "<Execute xmlns=\"schemas.microsoft.com/.../Services\" xmlns:i=\"www.w3.org/.../XMLSchema-instance\">";
$xml .= "<request i:type=\"a:CreateRequest\" xmlns:a=\"schemas.microsoft.com/.../Contracts\">";
$xml .= "<Create xmlns=\"schemas.microsoft.com/.../Services\" xmlns:i=\"www.w3.org/.../XMLSchema-instance\">";
$xml .= "<entity xmlns:a=\"schemas.microsoft.com/.../Contracts\">";
$xml .= "<a:Attributes xmlns:b=\"schemas.datacontract.org/.../System.Collections.Generic\">";
$xml .= "<a:KeyValuePairOfstringanyType>";
$xml .= "<b:key>name</b:key>";
$xml .= "<b:value i:type=\"c:string\" xmlns:c=\"www.w3.org/.../XMLSchema\">test</b:value>";
$xml .= "</a:KeyValuePairOfstringanyType>";
$xml .= "</a:Attributes>";
$xml .= "<a:EntityState i:nil=\"true\" />";
$xml .= "<a:FormattedValues xmlns:b=\"schemas.datacontract.org/.../System.Collections.Generic\" />";
$xml .= "<a:Id>00000000-0000-0000-0000-000000000000</a:Id>";
$xml .= "<a:LogicalName>account</a:LogicalName>";
$xml .= "<a:RelatedEntities xmlns:b=\"schemas.datacontract.org/.../System.Collections.Generic\" />";
$xml .= "<a:RequestId i:nil=\"true\" />";
$xml .= " <a:RequestName>Create</a:RequestName>";
$xml .= "</entity>";
$xml .= "</Create>";
$xml .= "</request>";
$xml .= "</Execute>";
$xml .= "</s:Body>";

error is:

schemas.microsoft.com/.../ExecuteResponseurn:uuid:{81799FC2-BA0B-49B6-BC50-28D9D5135AB8}3243d104-12ff-4b3b-81ec-be50e7edd7ba2016-04-01T11:01:45.732Z2016-04-01T11:06:45.732ZWhoAmIUserIdb1f772af-be1f-4480-b0f2-ccd72bf170aaBusinessUnitId0839794e-f6d7-e511-80f7-3863bb35ad90OrganizationId57cf5d9d-8912-4c33-88f6-b20895013b33schemas.microsoft.com/.../ExecuteOrganizationServiceFaultFaulturn:uuid:{81799FC2-BA0B-49B6-BC50-28D9D5135AB8}00000000-0000-0000-0000-0000000000002016-04-01T11:01:46.668Z2016-04-01T11:06:46.668Zs:SenderRequest.RequestName-2147220989Request.RequestName2016-04-01T11:01:46.6684411Z-2147220970System.ArgumentNullException: Value cannot be null. Parameter name: Request.RequestName2016-04-01T11:01:46.6684411Zschemas.microsoft.com/.../ExecuteOrganizationServiceFaultFaulturn:uuid:{81799FC2-BA0B-49B6-BC50-28D9D5135AB8}00000000-0000-0000-0000-0000000000002016-04-01T11:01:46.668Z2016-04-01T11:06:46.668Zs:SenderRequest.RequestName-2147220989Request.RequestName2016-04-01T11:01:46.6684411Z-2147220970System.ArgumentNullException: Value cannot be null. Parameter name: Request.RequestName2016-04-01T11:01:46.6684411Z

but  i have passed a value to name parametrs of account entity "test";

when using another soap request then no error but account is not creating in microsoft dynamic crm.

 $xml = " <s:Body>";
 $xml .= " <request i:type=\"a:CreateRequest\" xmlns:a=\"schemas.microsoft.com/.../Contracts\">";
 $xml .= " <Create xmlns=\"schemas.microsoft.com/.../Services\">";
 $xml .= " <entity xmlns:b=\"schemas.microsoft.com/.../Contracts\" xmlns:i=\"www.w3.org/.../XMLSchema-instance\">";
 $xml .= " <b:Attributes xmlns:c=\"schemas.datacontract.org/.../System.Collections.Generic\">";
 $xml .= " <b:KeyValuePairOfstringanyType>";
 $xml .= " <c:key>name</c:key>";
$xml .= " <c:value i:type=\"d:string\" xmlns:d=\"www.w3.org/.../XMLSchema\">newaccount</c:value>";
 $xml .= " </b:KeyValuePairOfstringanyType>";
 $xml .= " </b:Attributes>";
 $xml .= " <b:EntityState i:nil=\"true\"/>";
 $xml .= "<b:FormattedValues xmlns:c=\"schemas.datacontract.org/.../System.Collections.Generic\"/>";
 $xml .= " <b:Id>00000000-0000-0000-0000-000000000000</b:Id>";
 $xml .= " <b:LogicalName>account</b:LogicalName>";
 $xml .= " <b:RelatedEntities xmlns:c=\"schemas.datacontract.org/.../System.Collections.Generic\"/>";
 $xml .= "<b:RequestId i:nil=\"true\" />";
 $xml .= " <b:RequestName>Create</b:RequestName>";
 $xml .= " </entity>";
 $xml .= " </Create>";
 $xml .= "</request>";

 $xml .= "</s:Body>";

the response from this request is:

schemas.microsoft.com/.../ExecuteResponseurn:uuid:{C5C54652-101D-83B5-F779-7A7FCA6B4E68}1badbfb5-5a33-4bfa-8140-ff07e6078a652016-04-01T11:15:14.379Z2016-04-01T11:20:14.379ZWhoAmIUserIdb1f772af-be1f-4480-b0f2-ccd72bf170aaBusinessUnitId0839794e-f6d7-e511-80f7-3863bb35ad90OrganizationId57cf5d9d-8912-4c33-88f6-b20895013b33

but account is not created.

 

please guide me.

 

thanks in advance

Akram


Viewing all articles
Browse latest Browse all 79901

Trending Articles