python编写简单程序访问A8系统
来源:互联网 发布:ubuntu安装空闲不可用 编辑:程序博客网 时间:2024/05/29 03:48
1,安装suds库,用于方便的调用WebServices。
2,以用户名和密码访问A8的验证服务获取token。此token有效期为15分钟分钟,每一次有效请求延长 10分钟, 最长 15分钟。
3,以token访问所需服务。以BPMService(业务单据流程集成服务)为例,提供以下方法:
getAllFormCollIdsByDateTime(xs:string token, xs:string beginDateTime, xs:string endDateTime, )getAllFormCollIdsByDateTimeAndState(xs:string token, xs:string beginDateTime, xs:string endDateTime, xs:int[] state, )getFlowState(xs:string token, xs:long flowId, )getFormApprovalState(xs:string token, xs:long id, )getFormCollIdsByDateTime(xs:string token, xs:string[] templateCode, xs:string beginDateTime, xs:string endDateTime, )getTemplateDefinition(xs:string token, xs:string templateCode, )launchFormCollaboration(xs:string token, xs:string senderLoginName, xs:string templateCode, xs:string subject, xs:string data, xs:long[] attachments, xs:string param, )launchHtmlCollaboration(xs:string token, xs:string senderLoginName, xs:string templateCode, xs:string subject, xs:string bodyContent, xs:long[] attachments, )sendFormCollaboration(xs:string token, xs:string senderLoginName, xs:string templateCode, xs:string subject, xs:string data, xs:string attachments, xs:string param, )
具体操作如下:
#!usr/bin/env python#coding: utf-8from suds.client import Client'''验证服务 authenticate(xs:string userName, xs:string password, )'''authority_url = 'http://{host}:{port}/seeyon/services/authorityService?wsdl' # host和port换成部署A8系统的client = Client(authority_url)token = client.service.authenticate('admin', 'passwd') # 获取令牌print token'''连接BPMservice'''form_url = 'https://{host}:{port}/seeyon/services/BPMService?wsdl'client = Client(form_url)print client'''获取模板(template)定义对象的XML组合,依次是[FlowExport, FormExport]'''template_export = client.service.getTemplateDefinition(token.id, "template") # template是在A8系统上设定的模板的名称flowXml = template_export[0]print flowXmlprint "************************************************"formXml = template_export[1]print formXmlprint "************************************************"'''发起表单流程'''attachments = []response = client.service.launchFormCollaboration(token = token.id, senderLoginName = 'admin', templateCode = 'test1', subject = 'form_test1', date = '', attachments = attachments, param = '0') print response print "************************************************" '''按时间段查询多个表单模板已经审批通过和结束的流程'''templates = ['template']flowId = client.service.getFormCollIdsByDateTime(token.id, templates, '2012-08-24 00:00:00', '2012-09-13 24:00:00') print flowId print "************************************************" '''获取某流程的流转状态'''state = client.service.getFlowState(token.id, flowId) print state
A8服务列表:
- python编写简单程序访问A8系统
- python编写的简单爬虫程序
- 编写Python程序访问需要cookie的网页
- Android嵌入式系统程序开发(基于Cortex-A8)
- python GUI编程——wxpython编写简单记事本程序
- 使用Python【mincemeat】编写简单的MapReduce程序
- Python 3.5 编写简单的百度贴吧采集程序
- Cortex A8,RTC程序
- 编写简单代理程序
- 编写简单java程序
- 简单java程序编写
- 编写简单java程序
- 编写简单java程序
- Python编写MapReduce程序
- python 交互程序编写
- 开始编写python程序
- 分享自己编写的一个很简单的网站访问跟踪程序
- (基础)Web数据库访问编写简单示例——图书售卖系统示例2
- 设计模式系列学习三:建造者模式(Builder)
- [OS] 用汇编语言编写一个Boot Sector显示"Hello world!" [李园7舍_404]
- String str1 = "123"; if("123".equals(str1))和if(str1=="123")的区别
- 细节命令
- MySQL性能优化的最佳20+条经验
- python编写简单程序访问A8系统
- Using librtmp library to publish a live stream to Wowza Media Server
- 程序员必知8大排序3大查找(二)
- asp.net 饼形报表
- 环境变量的修改方法
- 第十二章——SQLServer统计信息(3)——发现过期统计信息并处理
- 基于ksoap2的android WebService上传图片
- Python_cannot import name Counter
- 《UNIX网络编程01》 第十一章 高级名字与地址转换 getnameinfo