Dear Expert,
Can any one tell me the real example for the SAPUI5 MockServer setRequests?
requests
.
Default value is is[]
Each array entry should consist of an object with the following properties / values:
response
function. In addition to this, parameters can be written in this notation::param
. These placeholder will be replaced by regular expression groups.
My example: Does it correct? and how to correct the issue if it is not correct?
path: new RegExp("GetProdsByAlertDate(.*), :storeId='0000000528' "),
xhr.respondXML(iStatusCode, mHeaders, sXmlString)
. By default an XML header is set for response header
My example: Where should I handle the storeId parameter and how to assign a value to the parameter inside the function?
response: function(oXhr, storeId) {
jQuery.sap.require("jquery.sap.xml");
var oAnnotations = jQuery.sap.sjax({
url: sLocalUri,
dataType: "xml"
}).data;
oXhr.respondXML(200, { }, jQuery.sap.serializeXML(oAnnotations));
return true;
}