8、系统集成
更新时间: 2024-05-06 浏览次数: {{ hits }}

类名

H3.BizBus.IBizBus

接口清单

序号

接口名称

说明

1

Invoke

以WebService形式调用第三方接口

2

InvokeApi

以WebApi形式调用第三方接口

3

GetList

以WebService形式获取表单数据

基本用法

上述清单中的接口均归属在this.Engine.BizBus下,具体用法详见于接口说明的示例部分。

接口说明

1. Invoke(string userId, AccessPointType type, string schemaCode, string methodName, BizStructure param)

1.1. 说明

WebService 形式调用第三方接口。兼容旧版本,由于氚云能配置连接上的 WebService 必须按照规定格式进行定义,且只对.NET 框架下开发的 WebService 兼容性友好,对于 JAVAPython 等语言兼容性较差。因此,更推荐使用InvokeApi,用于氚云调用第三方 Web API 服务。

1.2. 参数

参数名

说明

userId

用户ID

type

要进行的操作的系统类型,详见H3.BizBus.AccessPointType

schemaCode

表单编码

methodName

要执行的方法名称

param

业务结构,用来传递可自解析的数据,详见H3.BizBus.BizStructure

1.3. 返回值

类型

说明

H3.BizBus.InvokeResult

调用返回结果

1.4. 示例

详见氚云调用WebService

2. InvokeApi(string userId, AccessPointType type,  string code, string method, string contentType, Dictionary<string, string> headers, Dictionary<string, string> queries, Dictionary<string, object> bodies, BizStructureSchema structureSchema)

2.1. 说明

WebApi 形式调用第三方接口。第三方Api要求:http/https协议,请求参数和响应数据不支持文件类型,且响应数据必须是JSON格式,推荐用法

2.2. 参数

参数名

说明

userId

用户ID

type

要进行的操作的系统类型,详见H3.BizBus.AccessPointType

code

表单编码

method

方法名称,如GETPOST等,字母必须全大写

contentType

内容类型,如application/json

headers

请求头

queries

查询条件

bodies

请求头

structureSchema

业务结构,用来传递可自解析的数据,详见H3.BizBus.BizStructureSchema

2.3. 返回值

类型

说明

H3.BizBus.InvokeResult

调用返回结果

2.4. 示例

详见第三方连接

3. GetList(string userId, AccessPointType type, string schemaCode, Filter filter)

3.1. 说明

WebService 形式获取表单数据。

3.2. 参数

参数名

说明

userId

用户ID

type

要进行的操作的系统类型,详见H3.BizBus.AccessPointType

schemaCode

表单编码

filter

过滤条件,详见H3.Data.Filter.Filter

3.3. 返回值

类型

说明

H3.BizBus.ListResult

查询结果

3.4. 示例

string userId = this.Request.UserContext.UserId;
H3.Data.Filter.Filter filter = new H3.Data.Filter.Filter();
H3.BizBus.AccessPointType type = H3.BizBus.AccessPointType.Legacy;

//webservice查询数据
H3.BizBus.ListResult lstResult = this.Engine.BizBus.GetList(userId, type, "D000001ABC", filter);
if(lstResult != null && lstResult.Data.Length > 0)
{
    foreach(H3.BizBus.BizStructure structure in lstResult.Data)
    {
        // 处理相关逻辑
    }
}