UI5-技术篇-Expand与Deep 服务测试
1.SEGW创建服务

2.创建Data Model

2.1Entity Types
ZRICO_USR 设置主键、排序字段、过滤字段

ZRICO_USRITM设置主键 
2.2Associations
创建associations,设置主要实体 ZRICO_USR ,依赖实体ZRICO_USRITM,两者对应关系N:M


0:0...1 记录可有可无,最多一条记录
1:1必须存在一条记录
M:0..n记录可有可无,可有n条记录
N:1...n至少存在一条记录,可有n条记录

主表与从表字段关联关系,如上图。

2.3Navigation Properties

3.Service Implementation

4.Runtime Artifacts

5.类方法重写
/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY
method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY.
**try.
*CALL METHOD SUPER->/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY
* EXPORTING
** iv_entity_name =
** iv_entity_set_name =
** iv_source_name =
* IO_DATA_PROVIDER =
** it_key_tab =
** it_navigation_path =
* IO_EXPAND =
** io_tech_request_context =
** importing
** er_deep_entity =
* .
** catch /iwbep/cx_mgw_busi_exception .
** catch /iwbep/cx_mgw_tech_exception .
**endtry.
data:
begin of wa_deep_entity ,
mandt type zrico_usr-mandt,
usrid type zrico_usr-usrid,
usrname type zrico_usr-usrname,
usraddr type zrico_usr-usraddr,
headertoitem type standard table of zrico_usritm with default key.
data:end of wa_deep_entity . data:
ls_deep_entity like wa_deep_entity,
ls_header type zrico_usr.
data:
lt_deep_entity like table of wa_deep_entity,
lt_items type table of zrico_usritm. field-symbols:
<fs_item> like line of lt_items. "Get data from front-end
io_data_provider->read_entry_data(
importing
es_data = ls_deep_entity ). "Process data received
"Data-action here****************
loop at ls_deep_entity-headertoitem assigning <fs_item>.
<fs_item>-usrte = ''.
endloop.
"Data-action here**************** "Returned processed data back to front-end
copy_data_to_ref( exporting is_data = ls_deep_entity changing cr_data = er_deep_entity ). clear ls_deep_entity.
endmethod.
/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITYSET
method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITYSET.
**try.
*CALL METHOD SUPER->/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITYSET
** exporting
** iv_entity_name =
** iv_entity_set_name =
** iv_source_name =
** it_filter_select_options =
** it_order =
** is_paging =
** it_navigation_path =
** it_key_tab =
** iv_filter_string =
** iv_search_string =
** io_expand =
** io_tech_request_context =
** importing
** er_entityset =
** et_expanded_clauses =
** et_expanded_tech_clauses =
** es_response_context =
* .
** catch /iwbep/cx_mgw_busi_exception .
** catch /iwbep/cx_mgw_tech_exception .
**endtry.
data:
begin of wa_deep_entity ,
mandt type zrico_usr-mandt,
usrid type zrico_usr-usrid,
usrname type zrico_usr-usrname,
usraddr type zrico_usr-usraddr,
headertoitem type standard table of zrico_usritm with default key.
data:end of wa_deep_entity . data:
rt_usrid type range of zrico_usr-usrid.
data:
lt_deep_stru like table of wa_deep_entity.
data:
ls_usr type zcl_zrico_deep_usr_mpc_ext=>ts_zrico_usr,
ls_usritm type zcl_zrico_deep_usr_mpc_ext=>ts_zrico_usritm,
ls_filter type /iwbep/s_mgw_select_option,
ls_option type /iwbep/s_cod_select_option,
ls_deep_stru like wa_deep_entity,
ls_expand like line of et_expanded_tech_clauses,
ls_range like line of rt_usrid.
data:
lv_usrid type zrico_usr-usrid. "过滤条件
loop at it_filter_select_options into ls_filter.
loop at ls_filter-select_options into ls_option.
translate ls_filter-property to upper case.
case ls_filter-property.
when 'USRID'.
lv_usrid = ls_option-low.
when others.
endcase.
endloop.
endloop. if lv_usrid is not initial.
ls_range-sign = 'I'.
ls_range-option = 'EQ'.
ls_range-low = lv_usrid.
append ls_range to rt_usrid.
endif. select *
into corresponding fields of ls_deep_stru
from zrico_usr
where usrid in rt_usrid.
if sy-subrc = .
select *
into corresponding fields of table ls_deep_stru-headertoitem
from zrico_usritm
where usrid = ls_deep_stru-usrid. append ls_deep_stru to lt_deep_stru.
clear:ls_deep_stru.
endif.
endselect. ls_expand = 'HEADERTOITEM'.
append ls_expand to et_expanded_tech_clauses. if iv_entity_set_name = 'ZRICO_USRSet'
and io_expand->compare_to_tech_names( 'HEADERTOITEM') EQ io_expand->gcs_compare_result-match_equals . clear:er_entityset. copy_data_to_ref(
exporting
is_data = lt_deep_stru
changing
cr_data = er_entityset ). endif.
endmethod.
6.服务注册

7.Postman服务测试
7.1GET_EXPANDED_ENTITYSET测试



7.2CREATE_DEEP_ENTITY测试

获取上一步GET到的TOKEN

BODY赋值,如上图。

UI5-技术篇-Expand与Deep 服务测试的更多相关文章
- vs自带服务测试工具
在vs安装目录有一个vs自带的服务测试工具,地址为: "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Wcf ...
- 12个强大的Web服务测试工具
在过去的几年中,web服务或API的普及和使用有所增加. web服务或API是程序或软件组件的集合,可以帮助应用程序进行交互或通过形成其他应用程序或服务器之间的连接执行一些进程/事务处理.基本上有两种 ...
- swagger结合dubbo的rest服务测试
swagger结合dubbo的rest服务测试 背景介绍 我们应用的dubbo服务导出,可能没有直接的触发点去发起调用测试,除非自己手写controller和test类,缺乏一个动态工具,类似流行的s ...
- centos HA高可用集群 heartbeat搭建 heartbeat测试 主上停止heartbeat服务 测试脑裂 两边都禁用ping仲裁 第三十二节课
centos HA高可用集群 heartbeat搭建 heartbeat测试 主上停止heartbeat服务 测试脑裂 两边都禁用ping仲裁 第三十二节课 heartbeat是Linu ...
- CODING DevOps 系列第五课:微服务测试——微服务下展开体系化的微服务测试
微服务测试的痛点与挑战 这张图可以形象地展示单体服务和微服务的对比,单体应用就像左边巨大的集装箱,软件模块和应用都包括其中:而微服务就像是由一个小集装箱组成,微小的服务组成一个庞大.完整的系统.单体服 ...
- UI5-技术篇-SEGW DEEP ENTITY测试
参考:http://blog.sina.com.cn/s/blog_a7d67d810102xgms.html 一般调用后端的OData服务需要同时传输多个记录表对业务逻辑进行处理(例如BAPI),今 ...
- Asp.net 面向接口可扩展框架之使用“类型转化基础服务”测试四种Mapper(AutoMapper、EmitMapper、NLiteMapper及TinyMapper)
Asp.net 面向接口可扩展框架的“类型转化基础服务”是我认为除了“核心容器”之外最为重要的组成部分 但是前面博文一出,争议很多,为此我再写一篇类型转化基础服务和各种Mapper结合的例子,顺便对各 ...
- ASP.NET WebAPI 生成帮助文档与使用Swagger服务测试
帮助HELP 要实现如WCF中的Help帮助文档,Web API 2 中已经支持很方便的实现了这一特性 http://www.asp.net/web-api/overview/creating-we ...
- 服务测试碰钉子Server GC
如果发现你的dotnet core服务并发上不去,但cpu资源还比较充足那就要注意了!因为这很有可能是你没有设置一个运行项导致...,下面要提到的就是GC.Server这玩意,实际上项目编译中并没有这 ...
随机推荐
- shell编程系列12--文本处理三剑客之sed利用sed修改文件内容
shell编程系列12--文本处理三剑客之sed利用sed修改文件内容 修改命令对照表 编辑命令 1s/old/new/ 替换第1行内容old为new ,10s/old/new/ 替换第1行到10行的 ...
- tengine无法解析ssi报错 Nginx: unsafe URI detected while sending response
Nginx: unsafe URI detected while sending response 现象:# 类似 <!--#include virtual="../library/h ...
- OpenBLAS编译 Debug x64 Win10 vs2015
OpenBLAS编译 Debug x64 Win10 vs2015 >------ 已启动生成: 项目: ZERO_CHECK, 配置: Debug x64 ------ > Che ...
- ckpt pb
(t20190518) luo@luo-All-Series:/dev/disk_2019/mask_rcnn_20190518/Mask_RCNN_20190902/models/research$ ...
- 算法习题---5.2木块问题(UVa101)
一:题目 输入n,得到编号为0~n-1的木块,分别摆放在顺序排列编号为0~n-1的位置.现对这些木块进行操作,操作分为四种. .move a onto b:把木块a.b上的木块放回各自的原位,再把a放 ...
- 使用idea创建简单的webservice服务
New project: 生成HelloWorld.wsdl: 配置好tomcat后还需要加入 Axis 的库: 启动后,访问http://localhost:8080/services: 点击He ...
- 深层对象转深层数组(重点:先把对象转数组,直接for in 遍历对象不太可行)
var json: { PRow0: { style: { width: 10 } }, PTable1: { style: { height: 20 } } } const jsonToArrTre ...
- 【kubernetes 自带监控】 container级别cadvisor+kubelet,集群级别apiserver
apiserver https://feisky.gitbooks.io/kubernetes/components/apiserver.html kube-apiserver 支持同时提供 http ...
- 解释张量及TF的一些API
张量的定义 张量(Tensor)理论是数学的一个分支学科,在力学中有重要应用.张量这一术语起源于力学,它最初是用来表示弹性介质中各点应力状态的,后来张量理论发展成为力学和物理学的一个有力的数学工具.张 ...
- Selenium(二十):expected_conditions判断页面元素
1. 判断元素(expected_conditons) 作为一个刚刚转到python开发的小朋友,在开发前只将前辈们封装的方法看了一遍,学了一边selenium基础.看到封装的方法有什么判断元素是否存 ...