如何为 XSJS 服务设置 Mockserver 和 mockdata? [英] How to setup Mockserver and mockdata for XSJS service?

查看:51
本文介绍了如何为 XSJS 服务设置 Mockserver 和 mockdata?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 SAPUI5 Demokit 上,我找到了在数据源为 xsodata 服务时设置 mockserver 和 mockdata 的文档.

On the SAPUI5 Demokit I found the documentation for setting up the mockserver and mockdata when the datasource is xsodata service.

但我想设置 mockserver 和 mockdata,其中清单没有数据源,也没有提到模型,我在我的控制器中设置默认模型,借助我使用 jQuery 调用的 Xsjs 服务返回的 JSON 数据.获取().

But I want to set up mockserver and mockdata where the manifest has no datasource and no model mentioned and I am setting up the default model in my controller with the help of JSON data returned by my Xsjs service which I call using jQuery.get().

但是当服务是 xsjs 并且清单中未提及时,我无法找到有关设置模拟数据和模拟服务器的文档.

But I am not able to find documentation regarding setting up mockdata and mockserver when the service is xsjs and it is not mentioned in manifest.

如果有人有任何关于如何执行此操作的链接或示例,那么如果您能提供链接,将会非常有帮助.

If anyone has any link or example on how to do this then it will be very helpful if you can provide with links.

谢谢.

推荐答案

对应于 FAQ 部分中的这个答案应该是可能的:

Corresponding to this answer in the FAQ section it should be possible:

https://https://www.helplib.net/viewer/0ce0b8c56fa74dd897fffda8407e8272/7.5.9/en-US/c9a91ddaef47461c9c44bfc2198ea3f0.html

模拟服务器是否可以用于 OData 服务模拟以外的其他用途?

Can the mock server be used for more than for OData service simulation?

是的.模拟服务器可用于帮助您在任何给定 API 上伪造服务器响应,并存根对 OData 服务、元数据等资源的所有 AJAX 访问.注释文件 (XML)、其他 JSON 或 *.properties 文件.

Yes. The mock server can be used to help you fake server response on any given API and stub all AJAX access to resources such as OData service, metadata, > annotation files (XML), other JSON or *.properties files.

这篇关于如何为 XSJS 服务设置 Mockserver 和 mockdata?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆