Hello There,
So today i started to work on SOAP concepts. i was working on this example where based on GUID of contact we retrieve all its details.
function readme(){
var xml = "" +
"<s:Envelope xmlns:s=\"schemas.xmlsoap.org/.../\"><s:Body><Execute xmlns=\"schemas.microsoft.com/.../Services\" xmlns:i=\"www.w3.org/.../XMLSchema-instance\"><request i:type=\"a:RetrieveRequest\" xmlns:a=\"schemas.microsoft.com/.../Contracts\"><a:Parameters xmlns:b=\"schemas.datacontract.org/.../b:key><b:value i:type=\"a:EntityReference\"><a:Id>604e43ed-7d63-e411-88fc-9cb6548d72f4</a:Id><a:LogicalName>contact</a:LogicalName><a:Name i:nil=\"true\"/></b:value></a:KeyValuePairOfstringanyType><a:KeyValuePairOfstringanyType><b:key>ColumnSet</b:key><b:value i:type=\"a:ColumnSet\"><a:AllColumns>true</a:AllColumns><a:Columns xmlns:c=\"schemas.microsoft.com/.../a:Parameters><a:RequestId i:nil=\"true\"/><a:RequestName>Retrieve</a:RequestName></request></Execute></s:Body></s:Envelope>" +
"";
//var xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
//var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
if (window.XMLHttpRequest) {
xmlHttpRequest=new XMLHttpRequest(); // For all modern
} else if (window.ActiveXObject) {
xmlHttpRequest=new ActiveXObject("Microsoft.XMLHTTP"); // For (older) IE
}
xmlHttpRequest.open("POST", Xrm.Page.context.getClientUrl() +"/XRMServices/2011/Organization.svc/web", false);
xmlHttpRequest.setRequestHeader("SOAPAction","schemas.microsoft.com/.../Execute");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Accept", "application/xml, text/xml, */*");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
xmlHttpRequest.send(xml);
var resultXml = xmlHttpRequest.responseText;
alert(resultXml); //This printed out the response well.
var resultXml1 = xmlHttpRequest.responseXML;
alert("The real value" +resultXml1);
}
for the above code i have Updated SOAPlogger. :)
I have looked at responseXML and found it has all the feilds like lastname,address, and other stuff.
what i need to know is , how do i get the data from the responseXML and show it on Xrm form (Ex: say Alert box of lastname)
Any ideas? :)
Guide me onto those resources please,
Thank you
*This post is locked for comments
I have the same question (0)