InfoPath 2010中调用Web Service

一、设计表单

新建一个InfoPath 空白表单,插入一个2*4Table,输入开始时间、结束时间、计算结果,并拖入三个文本框和一个按钮控件,修改按钮文本显示为“计算天数”。表单如下显示:
InfoPath 2010中调用Web Service_第1张图片

 二、添加数据连接

在InfoPath 按照以下方式添加数据连接:
InfoPath 2010中调用Web Service_第2张图片

 按照这样的步骤操作:

点击Add按钮—〉 Receive Data—〉选择SOAP Web Service—〉输入Web Service 地址
—〉选择要调用的方法名—〉默认参数名—〉Store a copy of the data in the form template.
—〉输入该数据连接名称—〉取消Automatically retrieve data when form is opened.

 三、设置按钮提交规则

按照顺序设置以下规则:

3.1、设置参数值规则
3.2、Query using  a data connection.
3.3、将查询结果赋值
InfoPath 2010中调用Web Service_第3张图片

 四、执行结果
InfoPath 2010中调用Web Service_第4张图片

 

 

你可能感兴趣的:(Web,service)