/// <summary> /// 填充模板 /// </summary> public void templateFill() { TemplateFillRequest templateFillRequest = new TemplateFillRequest(); templateFillRequest.template_id = "983e7c49532738a14e1d1aeb02d65775"; templateFillRequest.user_id = "00765245060136194048"; templateFillRequest.name = "测试合同"; SimpleFormField simpleFormField = new SimpleFormField(); simpleFormField.key = "name"; simpleFormField.value = "我的印章测试"; templateFillRequest.addSimpleFormField(simpleFormField); try { TemplateFillResponse response = client.Template.templateFill(templateFillRequest); 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); } }
public void addSimpleFormField(SimpleFormField simpleFormField) { (simple_form_fields = simple_form_fields == null ? new List <SimpleFormField>() : simple_form_fields).Add(simpleFormField); }