目前网关需要加载本地接口定义的功能为: 根据接口定义发布webservice服务,生成wsdl描述
关于webservice服务
配置示例:
inbound_channel:
values:
- channelType: inbound
protocolType: http
available: true
contentType: webservice
inMessagePool: {poolMode: SHARE, corePoolSize: 2, maximumPoolSize: 50, keepAliveTime: 60,
available: true}
id: rcs-in-webservice
name: rcsWebserviceChannel
started: true
#解析器后置filter 移动到param
values:
- port: %{pre.inbound.webservice.port}
id: webserviceConnector
protocolType: http
started: true
contentType: webservice
type: webservice
mappings:
#必须指定服务名,接口名和方法名
# 企业划型参数接口
- {serviceName: RcsentdelimitparamService, interfaceName: cmbc.rcs.integration.cm.loanbefore.rcsentdelimitparam.service.RcsentdelimitparamService, methodName: execute}
# 好房产校验接口
- {serviceName: RcsGoodHouseQueryService, interfaceName: cmbc.rcs.integration.cm.loanbefore.rcsgoodhousequery.service.RcsgoodhousequeryService, methodName: execute}
# 额度测算
- {serviceName: RcsLimitMeasureService, interfaceName: cmbc.rcs.integration.cm.loanbefore.rcslimitmeasure.service.RcslimitmeasureService, methodName: execute}
#合同模板查询接口(未上线)
- {serviceName: RCSConTemplateQueryService, interfaceName: cmbc.rcs.integration.cm.contract.rcscontemplatequery.service.RcscontemplatequeryService, methodName: execute}
#通用评分查询
- {serviceName: RCSGradeService, interfaceName: cmbc.rcs.integration.gateway.function.loanbefore.grade.service.RcsGradeServcie, methodName: gradeExecute}
#用于服务健康检查
- {serviceName: IREService, interfaceName: com.rcs.intergation.GatewayCheak, methodName: cheak}
网关在Inbound端发布webservice有两种方式
根据接口发布webservice服务,如接口
mappings: #必须指定服务名,接口名和方法名,路由时可根据服务名或接口名,对应的key分别为gateway_ws_service_name,gateway_ws_interface_name - {serviceName: a, interfaceName: cmbc.rcs.integration.pe.service.PeService, methodName: SPEQryManyOrderTransService} - {serviceName: b, interfaceName: cmbc.rcs.integration.pe.service.PeService, methodName: SPEQryOneOrderBookTransService} - {serviceName: c, interfaceName: cmbc.rcs.integration.pe.service.PeService, methodName: SPEQryOneOrderTransService} - {serviceName: d, interfaceName: cmbc.rcs.integration.pe.service.PeService, methodName: SPEQryTransDetailService} 这样就发布了基于 PeService接口的四个webservice服务, 发布之后,获取wsdl的请求路径为 /*/a.wsdl 或/*/a?wsdl, 访问服务的路径为/*/a
根据本地配置wsdl文件发布服务
params: {wsdlpath: ./wsdl-for-test/a} 如果实际wsdl文件的路径为 C:\Users\xxx\Desktop\test\wsdl-for-test\a\ws\wsHelloWorld.wsdl, 则请求路径必须为/ws/wsHelloWorld 才能访问到服务
网关也支持通过动态渠道从注册中心拉取webservice服务,json服务,或者rpc服务