
# 利用合约查询数据
1. 查询请求消息构建 
   - 接口函数 func (msg \*ContractRawMessage) BuildInvokeMessage(chainID string, name string, function string, args \[\]string) (\*common.RawMessage, error)
     
   
   - 参数说明
     
     | 参数       | 类型         | 说明         |
     |:---|:---|:---|
     | chainID  | string     | 链名称。       |
     | name     | string     | 合约名称。      |
     | function | string     | 调用合约中的方法名。 |
     | args     | \[\]string | 合约方法参数。    |
        
     
   
   - 返回值
     
     | 类型                  | 说明                      |
     |:---|:---|
     | \*common.RawMessage | 查询请求需发送的消息。             |
     | error               | 发送成功返回类型为nil，反之返回error。 |
        
     
   
   
   
   
2. 查询请求消息发送。 
   - 接口函数
     ```
     func (action *ContractAction) Invoke(rawMsg *common.RawMessage) (*common.RawMessage, error)
     ```
     
   
   - 参数说明
     
     | 参数     | 类型                  | 说明            |
     |:---|:---|:---|
     | rawMsg | \*common.RawMessage | 上述查询请求需发送的消息。 |
        
     
   
   - 返回值
     
     | 类型                  | 说明                      |
     |:---|:---|
     | \*common.RawMessage | 查询请求返回的消息。              |
     | error               | 发送成功返回类型为nil，反之返回error。 |
        
     
   
   
   
   
 
