cancel
Showing results for 
Search instead for 
Did you mean: 

MockServer calling OData Service with function import parameter

barrettezhong
Member
0 Kudos

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:

  • method : "GET"
  • path : "/path/to/resource"
    The path is converted to a regular expression, so it can contain normal regular expression syntax. All regular expression groups are forwarded as arguments to theresponsefunction. 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' "),

  • response : function(xhr, param1, param2, ...) { }
    The xhr object can be used to respond on the request. Supported methods are:
    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;
}

Accepted Solutions (0)

Answers (0)