1、使用Web Service使用者,导入webservice
2、生成webservice使用者
3、调用,很简单跟写普通代理没舍区别
'定义主类
Dim createDoc As EAMToBPMService_n0
Set createDoc = New EAMToBPMService_n0
'开发生产切换
Dim webserviceURL As String
If "devserver"=LCase(StrRight(StrLeft(db.Server,"/"),"=")) Then
webserviceURL = "http://bpmtest.dev.com/services/EAMToBPMService"
Else
webserviceURL = "http://bpm.org.com/services/EAMToBPMService"
End If
createDoc.Setendpoint(webserviceURL)
'定义输入输出数据类
Dim userName As String
Dim userType As String
Dim workflowCode As String
Dim jsonData As String
Dim rowData As String
'传参
userName = doc.cashierAD(0)
userType = "2"
workflowCode = "FI666"
Dim rowstr As String
Dim payType As String
rowstr = "{FI666:["
rowstr = rowstr+ "]}"
jsonData = ""
jsonData=jsonData+"{'FormVersion':'2',"
jsonData=jsonData+"'empDeptOA':666'}"
'调用
Dim returnInfo As String
returnInfo = createDoc.createFast(userName,userType,workflowCode,jsonData,rowData)
'返回值处理
If InStr(returnInfo,"true") > 0 Then
doc.Cur_approver = "CN=devin/O=AAC"
doc.BPMinfo = returnInfo
Else
doc.errmsg = "<font color=red>" + returnInfo + "</font>"
Exit Sub
End If