SOAP Calls using JavaScript No Longer Work after Polaris Update

Following the Polaris update on almost all CRM Online instances that I have worked
on, I notice that FetchXML calls via JavaScript and SOAP have stopped working.
I used one of the many similar 3rd party JavaScript libraries and sample codes found
on the Internet – “FetchUtil” that looks like below:
FetchUtil.prototype._FetchCallback = function (xmlhttp, callback) {
 if (xmlhttp.readyState != XMLHTTPREADY) {
 return;
 }
 if (this._HandleErrors(xmlhttp)) {
 return;
 }
 var sFetchResult = newxmlhttp.selectSingleNode('//a:Entities').xml; // Code fails here: unsupported method
 var resultDoc = new ActiveXObject('Microsoft.XMLDOM');
 resultDoc.async = false;
 resultDoc.loadXML(sFetchResult);
 ...
}


Until I’ve found a better workaround, the following seems to do the trick for now,
though it may mean the users have to stick with Internet Explorer only:

FetchUtil.prototype._FetchCallback = function (xmlhttp, callback) {
 if (xmlhttp.readyState != XMLHTTPREADY) {
 return;
 }
 if (this._HandleErrors(xmlhttp)) {
 return;
 }

 var newxmlhttp = new ActiveXObject('Microsoft.XMLDOM');
 newxmlhttp.async = false;
 newxmlhttp.loadXML(xmlhttp.responseText);

 var sFetchResult = newxmlhttp.selectSingleNode(‘//a:Entities’).xml;

 var resultDoc = new ActiveXObject('Microsoft.XMLDOM');
 resultDoc.async = false;
 resultDoc.loadXML(sFetchResult);
 ...
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s