目前網關需要(yào / yāo)加載本地(dì / de)接口定義的(de)功能爲(wéi / wèi): 根據接口定義發布webservice服務,生成wsdl描述
關于(yú)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 移動到(dào)param
values:
- port: %{pre.inbound.webservice.port}
id: webserviceConnector
protocolType: http
started: true
contentType: webservice
type: webservice
mappings:
#必須指定服務名,接口名和(hé / huò)方法名
# 企業劃型參數接口
- {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}
#合同模闆查詢接口(未上(shàng)線)
- {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}
#用于(yú)服務健康檢查
- {serviceName: IREService, interfaceName: com.rcs.intergation.GatewayCheak, methodName: cheak}
網關在(zài)Inbound端發布webservice有兩種方式
根據接口發布webservice服務,如接口
mappings: #必須指定服務名,接口名和(hé / huò)方法名,路由時(shí)可根據服務名或接口名,對應的(de)key分别爲(wéi / wèi)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} 這(zhè)樣就(jiù)發布了(le/liǎo)基于(yú) PeService接口的(de)四個(gè)webservice服務, 發布之(zhī)後,獲取wsdl的(de)請求路徑爲(wéi / wèi) /*/a.wsdl 或/*/a?wsdl, 訪問服務的(de)路徑爲(wéi / wèi)/*/a
根據本地(dì / de)配置wsdl文件發布服務
params: {wsdlpath: ./wsdl-for-test/a} 如果實際wsdl文件的(de)路徑爲(wéi / wèi) C:\Users\xxx\Desktop\test\wsdl-for-test\a\ws\wsHelloWorld.wsdl, 則請求路徑必須爲(wéi / wèi)/ws/wsHelloWorld 才能訪問到(dào)服務
網關也(yě)支持通過動态渠道(dào)從注冊中心拉取webservice服務,json服務,或者rpc服務