Is it possible to get the value of an AF attribute from a webservice ?
The two data access products which can read AF data are the PI OLEDB Enterprise and PI Webservices.
So if you have PI Webservices you can query it for the attribute in question, and if you have PI OLEDB Enterprise you can create your own webservice project which uses this as the way to collect AF data.
There should be examples for both products in the Library
I realize that my question was not clear at all.
I would like to create an attribute in an AF template whose value would be provided by an external webservice.
Thanks anyway for your quick answer.
Oh, well that's another question
To do this, I would look into AF Tables. An AFTable lets you link its content to external data sources, and you can have it be updated automatically (click the Link button) or manually (click the Import button).
It uses ODBC connections, and if you're not able to set up a webservice connection directly I'm sure you could use SQL Server or some other technology as a "host".
As long as you have data available in an AFTable, you can easily do a Table Lookup to collect data into your attributes.
I already used AF tables to retrieve data from external databases to display them in AF attributes, but this time I can access my external database only through webservices (tough architect job! ).
So I understand from your answer that I can't use these webservices directly. Too bad !
Thank you for yours answers. I will see if I can use your solution anyway.
Well, to my knowledge webservices can't be used directly. Feel free to arrest me on this, anyone :)
Take a look at the whitepaper (found under Whitepapers and tutorials\PI AF\ in the Library) called "Implementing AF 2.0 custom data references". There you will find both instructions and examples on how to write your own custom data references.
If you were to modify one of the examples - the StringConcat DR for example - I guess you can set it up to read the appropriate values from your specific webservice.
I've used the StringConcat DR myself, and even done a couple of modifications to suit my setup, and it works like a charm!
Julien, have you seen this thread?
We touched on starting a community project to provide an AF Data Reference to query web services...might still be an option if community members are still willing to contribute (looking at myself right now too ).
Thanks to both of you for your answers.
Maybe I will try to develop my own Data Reference...
@Julien: would you be so kind as to share what kind of data you would like to bring back into AF? What kind of web services are you talking about here?
These are custom web services provided by other components of the application we are developing.
Are there any updates on this issue already? We are actually looking for the same solution: Get a value from a external (not OSIsoft) Webservice, and feed this value to an AF Attribute.
The PI Connector for UFL supports reading from REST services.
Retrieving data ...