Пример #1
0
        /// <summary>
        /// 事件证书-批量模板签章
        /// </summary>
        /// <param name="signTemplateSingleRequest"></param>
        /// <returns></returns>
        public EventCertSignTemplateBatchResponse eventCertSignTemplateBatch(EventCertSignTemplateBatchRequest eventCertSignTemplateBatch)
        {
            SignRequest signRequest = new SignRequest(eventCertSignTemplateBatch);

            signRequest.apiUrl = ApiUrlConstant.Sign.EventCertTemplateBatch;
            EventCertSignTemplateBatchResponse response = this.Send <EventCertSignTemplateBatchResponse>(signRequest);

            return(response);
        }
Пример #2
0
        public void eventCertSignTemplateBatch()
        {
            EventCertSignTemplateBatchRequest signTemplateBatchRequest = new EventCertSignTemplateBatchRequest();

            signTemplateBatchRequest.template_id = "983e7c49532738a14e1d1aeb02d65775";
            EventCertBatchTemplates batchTemplates = new EventCertBatchTemplates();

            batchTemplates.custom_id = "12639f12a9e5374d824b45981f276cc5";

            EventCertSignParams param = new EventCertSignParams();

            param.height   = 50;
            param.width    = 50;
            param.user_id  = "00765245060136194048";
            param.seal_id  = "babeef37549d22cbb50ce5436cdb3037";
            param.sign_key = "sign";
            batchTemplates.addSignParams(param);

            EventCertTextParams textParam = new EventCertTextParams();

            textParam.key   = "day2";
            textParam.value = "批量测试";
            batchTemplates.addTextParams(textParam);

            signTemplateBatchRequest.addBatchTempLate(batchTemplates);

            try
            {
                EventCertSignTemplateBatchResponse response = client.EventCertSign.eventCertSignTemplateBatch(signTemplateBatchRequest);
                Console.WriteLine("事件证书-批量签章-响应数据:" + JSONUtil.getJsonStringFromObject(response));
            }
            catch (SignApplicationException sae)
            {
                // 捕获网关校验数据
                Console.WriteLine("事件证书-批量签章-网关异常状态码为:" + sae.return_code);
                Console.WriteLine("事件证书-批量签章-网关异常信息为:" + sae.return_message);
            }
            catch (SignServerException sse)
            {
                // 捕获网关校验数据
                Console.WriteLine("事件证书-批量签章-业务异常状态码为:" + sse.result_code);
                Console.WriteLine("事件证书-批量签章-业务异常信息为:" + sse.result_message);
            }
        }