Client em python

No scadaBR, eu criei um data source do tipo:Virtual Data Source
Neste data source, criei dois points
No client em python eu consigo:
client.getStatus()//recebo estatus
client.browseTags()//recebo as tags definidas nos points

A duvida é: como passar os paranetros adequados para o metodo readData()?

agradeço por qualquer ajuda.

Oi Vicente,

Você pode conferir o funcionamento de todos as funções da API no
http://:8080/ClienteJavaWeb/

É java, mas dá uma idéia de como acessar. Se precisar do código, o mesmo está no svn do sourceforge.

Se precisar de mais ajuda, posta ai! Vlw =]

Diego, obrigado pela referencia em Java, segui seu raciocinio e tive sucesso. Aproveito para parabenizar a todos os desenvolvedores do ScadaBR pelo excelente trabalho.

Segue a solução:

 

#download and install suds http://pypi.python.org/pypi/suds
#Create Data source name: machine1, type: "Virtual Data Source"
#Create Data Point name(type):
#counterProduct(Numeric/No change)
#enableMachine(Binary/No change)
#operatorID(Alphanumeric/No change)
 
from suds.client import Client
import datetime
 
dateStart = datetime.datetime.now()
 
client = Client('http://127.0.0.1:8080/ScadaBR/services/API?wsdl')
print '######################################'
print 'describing the service:'
print client
print '######################################'
#types are created as follows:
browseTagsOptions = client.factory.create('ns3:BrowseTagsOptions')
#note the type 
print 'BronseTagsOptions'
print browseTagsOptions
#set BrowseTagsParams
browseTagsOptions.maxReturn = 2
itemsPath = 'counterProduct'
#calling browseTags(xs:string itemsPath, ns3:BrowseTagsOptions options, )
BrowseTagsResponse = client.service.browseTags(itemsPath,browseTagsOptions)
print 'browse tag counterProduct'
print BrowseTagsResponse
#all tags
print 'ALL TAGS'
print client.service.browseTags()
print '######################################'
 
#browseEventsParams = client.factory.create('tns6:BrowseEventsParams')
getStatusResponse = client.factory.create('tns4:GetStatusResponse')
#browseEventsParams.options.eventType = True
#browseEventsParams.options.returnEventsConfig = True
getStatusResponse = client.service.getStatus()
print 'status'
print getStatusResponse
print '######################################'
 
#calling readData (xs:string[] itemPathList, ns3:ReadDataOptions options, )'
#create and set the parameters:
itemPathList = ['counterProduct','operatorID']
readDataOptions = client.factory.create('ns3:ReadDataOptions')
readDataOptions.maxReturn = 3
readDataResponse = client.service.readData(itemPathList , readDataOptions )
print 'reading tags: counterProduct , operatorID'
print readDataResponse
print 'reading the tag: counterProduct'
print readDataResponse.itemsList[0]
print 'reading only the value of tag: counterProduct'
print readDataResponse.itemsList[0].value
print '######################################'
 
#calling  writeStringData(ns5:ItemStringValue[] itemsList, ns3:WriteDataOptions options, )
#create and set the parameters:
writeDataOptions = client.factory.create('ns3:WriteDataOptions')
writeDataOptions.returnItemValues = True
itemStringList= client.factory.create('ns5:ItemStringValue')
dataType = client.factory.create('ns2:DataType')
quality = client.factory.create('ns2:QualityCode')
itemStringList.itemName = 'counterProduct'
itemStringList.dataType = dataType.FLOAT
itemStringList.value = 23.5
itemStringList.quality =quality.GOOD
itemStringList.timestamp = datetime.datetime.now()
writeStringDataResponse=client.service.writeStringData(itemStringList,writeDataOptions )
print 'writing on the tag counterProduct'
print  writeStringDataResponse
print '######################################'
 
#calling getDataHistory(xs:string itemName, ns4:GetDataHistoryOptions options, )
#create and set the parameters:
getDataHistoryOptions = client.factory.create('ns4:GetDataHistoryOptions')
print getDataHistoryOptions
itemName = 'counterProduct'
getDataHistoryOptions .maxReturn = 10
getDataHistoryOptions .initialDate = dateStart
itemStringList.value = 28.0
client.service.writeStringData(itemStringList,writeDataOptions )
itemStringList.value = 29.0
client.service.writeStringData(itemStringList,writeDataOptions )
itemStringList.value = 30.0
client.service.writeStringData(itemStringList,writeDataOptions )
itemStringList.value = 31.5
client.service.writeStringData(itemStringList,writeDataOptions )
getDataHistoryOptions.finalDate = datetime.datetime.now()
getDataHistoryResponse = client.factory.create('tns5:GetDataHistoryResponse')
print 'getDataHistoryResponse'
print getDataHistoryResponse
print 'Obtaining historical data of tag'
print client.service.getDataHistory(itemName,getDataHistoryOptions)
 
Ainda falta testar outros métodos,  se no parâmetro de entrada houver necessidade de anyType, devo pedir sua colaboração para tentar contornar.