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

Processing the results of a SOAP Execute message into JavaScript objects representing the returned entities

$
0
0

Hi all

This seems like it should've been done a thousand times, yet I'm not finding any good examples? Or maybe I'm searching for the wrong things...

Essentially, I execute aExecuteQuickFind request, and need to parse the results into usable JavaScript objects representing the returned entity records.

Request:

<request xmlns:a="schemas.microsoft.com/.../Contracts"><a:Parameters xmlns:b="schemas.datacontract.org/.../System.Collections.Generic"><a:KeyValuePairOfstringanyType><b:key>SearchText</b:key><b:value i:type="c:string" xmlns:c="www.w3.org/.../XMLSchema">test</b:value></a:KeyValuePairOfstringanyType><a:KeyValuePairOfstringanyType><b:key>EntityNames</b:key><b:value i:type="c:ArrayOfstring" xmlns:c="schemas.microsoft.com/.../Arrays"><c:string>account</c:string><c:string>contact</c:string></b:value></a:KeyValuePairOfstringanyType></a:Parameters><a:RequestId i:nil="true" /><a:RequestName>ExecuteQuickFind</a:RequestName></request>

And I get back the following response: 

<s:Body><ExecuteResponse xmlns="schemas.microsoft.com/.../Services"><ExecuteResult xmlns:a="schemas.microsoft.com/.../Contracts" xmlns:i="www.w3.org/.../XMLSchema-instance"><a:ResponseName>ExecuteQuickFind</a:ResponseName><a:Results xmlns:b="schemas.datacontract.org/.../System.Collections.Generic"><a:KeyValuePairOfstringanyType><b:key>Result</b:key><b:value i:type="a:QuickFindResultCollection"><a:QuickFindResult><a:Data><a:Entities/><a:EntityName>account</a:EntityName><a:MinActiveRowVersion>-1</a:MinActiveRowVersion><a:MoreRecords>false</a:MoreRecords><a:PagingCookie/><a:TotalRecordCount>-1</a:TotalRecordCount><a:TotalRecordCountLimitExceeded>false</a:TotalRecordCountLimitExceeded></a:Data><a:ErrorCode>0</a:ErrorCode><a:QueryColumnSet xmlns:c="schemas.microsoft.com/.../Arrays" i:nil="true"/></a:QuickFindResult><a:QuickFindResult><a:Data><a:Entities><a:Entity><a:Attributes><a:KeyValuePairOfstringanyType><b:key>fullname</b:key><b:value xmlns:c="www.w3.org/.../XMLSchema" i:type="c:string">A TEST</b:value></a:KeyValuePairOfstringanyType><a:KeyValuePairOfstringanyType><b:key>emailaddress1</b:key><b:value xmlns:c="www.w3.org/.../XMLSchema" i:type="c:string">atest@testemail.com</b:value></a:KeyValuePairOfstringanyType><a:KeyValuePairOfstringanyType><b:key>contactid</b:key><b:value xmlns:c="schemas.microsoft.com/.../Serialization" i:type="c:guid">********-****-****-****-************</b:value></a:KeyValuePairOfstringanyType><a:KeyValuePairOfstringanyType><b:key>entityimage_url</b:key><b:value xmlns:c="www.w3.org/.../XMLSchema" i:type="c:string">/Image/download.aspx?Entity=contact&amp;Attribute=entityimage&amp;Id=********-****-****-****-************&amp;Timestamp=636419355553591067</b:value></a:KeyValuePairOfstringanyType></a:Attributes><a:EntityState i:nil="true"/><a:FormattedValues/><a:Id>********-****-****-****-************</a:Id><a:KeyAttributes xmlns:c="schemas.microsoft.com/.../Contracts"/><a:LogicalName>contact</a:LogicalName><a:RelatedEntities/><a:RowVersion i:nil="true"/></a:Entity><a:Entity><a:Attributes><a:KeyValuePairOfstringanyType><b:key>fullname</b:key><b:value xmlns:c="www.w3.org/.../XMLSchema" i:type="c:string">Another TEST</b:value></a:KeyValuePairOfstringanyType><a:KeyValuePairOfstringanyType><b:key>emailaddress1</b:key><b:value xmlns:c="www.w3.org/.../XMLSchema" i:type="c:string">anothertest@testemail.com</b:value></a:KeyValuePairOfstringanyType><a:KeyValuePairOfstringanyType><b:key>contactid</b:key><b:value xmlns:c="schemas.microsoft.com/.../Serialization" i:type="c:guid">********-****-****-****-************</b:value></a:KeyValuePairOfstringanyType></a:Attributes><a:EntityState i:nil="true"/><a:FormattedValues/><a:Id>********-****-****-****-************</a:Id><a:KeyAttributes xmlns:c="schemas.microsoft.com/.../Contracts"/><a:LogicalName>contact</a:LogicalName><a:RelatedEntities/><a:RowVersion i:nil="true"/></a:Entity></a:Entities><a:EntityName>contact</a:EntityName><a:MinActiveRowVersion>-1</a:MinActiveRowVersion><a:MoreRecords>true</a:MoreRecords><a:PagingCookie>***Removed***</a:PagingCookie><a:TotalRecordCount>-1</a:TotalRecordCount><a:TotalRecordCountLimitExceeded>false</a:TotalRecordCountLimitExceeded></a:Data><a:ErrorCode>0</a:ErrorCode><a:QueryColumnSet xmlns:c="schemas.microsoft.com/.../Arrays" i:nil="true"/></a:QuickFindResult></b:value></a:KeyValuePairOfstringanyType></a:Results></ExecuteResult></ExecuteResponse></s:Body>

I need some representation of the return "account" and "contact" records that preserves their data types as much as possible. 

Any help would be much appreciated!
James 


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images