PI Web Services 2010 R3 User Guide
PI Web Services 2010 R3 User Guide
User Guide
OSIsoft, LLC
777 Davis St., Suite 250
San Leandro, CA 94577 USA
Tel: (01) 510-297-5800
Fax: (01) 510-357-8136
Web: http://www.osisoft.com
OSIsoft, the OSIsoft logo and logotype, PI Analytics, PI ProcessBook, PI DataLink, ProcessPoint, PI Asset Framework (PI AF), IT
Monitor, MCN Health Monitor, PI System, PI ActiveView, PI ACE, PI AlarmView, PI BatchView, PI Coresight, PI Data Services, PI
Manual Logger, PI ProfileView, PI WebParts, ProTRAQ, RLINK, RtAnalytics, RtBaseline, RtPortal, RtPM, RtReports and RtWebParts
are all trademarks of OSIsoft, LLC. All other trademarks or trade names used herein are the property of their respective owners.
Chapter 4 Troubleshooting.........................................................................................................71
IIS is Not Running ............................................................................................................71
Server Not Found .............................................................................................................72
PI System Not Found .......................................................................................................72
Remote Connection Failure .............................................................................................72
Data Entry Disallowed ......................................................................................................73
Insufficient Permissions....................................................................................................73
Insufficient Message Size ................................................................................................73
Execution of Performance Equations Disallowed ............................................................74
Filters or Parameters Not Supported ...............................................................................74
Server Error in PI Web Services Application ...................................................................75
Index ............................................................................................................................................131
iv
Chapter 1
Introduction
PI Web Services 2010 R3 enables PI System data to be transmitted through standard Internet
protocols. When used with the Web services client application of your choice, PI Web
Services allows end users to submit simple Web services requests that send and receive PI
System data.
The ability to call Web services is common to most operating systems; therefore developers
can create Web service client applications on the operating system platforms of their choice.
PI Web Services provides the programmatic interfaces and Web methods that developers
need to create client applications that use Web service calls to securely pass PI System data
over networks.
For example, you might use PI Web Services to build solutions that:
• Display PI data on a Web site
• Integrate with line-of-business systems that support calling Web services
• Allow both Windows and non-Windows environments to easily access PI data, or submit
data to PI systems
These examples illustrate some of the key advantages that PI Web Services provides,
including:
• Ability to integrate with applications, regardless of the programming language or
platform
• Broad access to PI System data and features
• Interfaces designed to work with client tools that require only configuration – not code –
to set up Web service queries
• Central administration and regulation
• Standards-based interoperability, particularly WS-Interoperability and WS-Security
• Readily available secure connections
PI Web Services is a member of the PI Data Access product suite (page 2).
In this Guide
This guide includes procedures to install and configure PI Web Services on a Web server, or
through a Windows service. It also provides information about how to ensure your PI System
data is transmitted securely and how to resolve common errors that PI Web Services users
and developers might encounter. To help you get started with your security setup, PI Web
Services includes configuration files you can use to modify security settings and control
application behavior.
The PI Web Services Programmer Reference (page 77) describes the programming
components, including interfaces, Web methods, classes and properties, which are required to
build custom Web service applications that interact with PI Systems through Web services.
For more information about building and deploying Web services client applications that
access PI Web Services and using third-party Web services clients to invoke the Web
methods, OSIsoft recommends that you consult programmer resources such as the MSDN
Web site (http://msdn.microsoft.com/).
For supplementary support and information about PI Web Services, see the OSIsoft vCampus
Web site (http://vCampus.osisoft.com), which provides various technical resources including
a blog, discussion forum and Webinars dedicated to PI Web Services.
2
Architecture
Architecture
A typical scenario for using PI Web Services includes computers that host:
• PI Web Services
• PI Asset Framework (PI AF) or a PI AF collective
• PI Server, or PI collective
• Web services applications
PI Web Services is typically hosted on an Internet Information Services (IIS) Web Server.
For details about how to connect PI Web Services to a PI System, see Install PI Web Services
(page 15) and Change the Endpoint and Active Configuration Bindings (page 56). For an
example that shows how to set up the connections to Web services applications, see
Configure Security for .NET Clients (page 61).
You may also host PI Web Services as a Microsoft Windows service (page 40).
Note: If you are using the netTCPBinding or netNamedPipes bindings, you must use IIS
7 or later. For details, see Configure Secure Web Service Access (page 53).
End-users enter queries into Web services applications on the client machines. The queries
are sent to the Web server hosting PI Web Services, where they are checked for errors and
translated into calls to PI Data Services (page 6), the data access layer that PI Web Services
uses to access data from the PI System.
In response to the queries, PI System data is returned by PI Data Services (page 6) to PI Web
Services, where it is reformatted into the data structures defined by the PI Web Services
interfaces (page 77). These structures and data representations adhere to Web service
standards and are designed to provide maximum interoperability with third-party software.
The reformatted data is returned to the client that hosts the Web service application, where
the user can work with the data.
Summary of Features
PI Web Services consists of a Windows Communication Foundation (WCF) service that
allows users to access PI System data through Simple Object Access Protocol (SOAP)
compliant Web services clients.
• The Web service provides two interfaces:
ο IPITimeSeries – To retrieve time series data supported by the PI System and receive
updates to supported data events. This includes PI points and time series data that are
referenced by PI AF attributes. Future releases will add support for the other major PI
System data types (page 9).
ο IPISearch – for searches the PI System that yield search results consisting of paths
for use with IPITimeSeries.
• Support of these standard PI summary calculations: averages, minima, maxima, ranges,
totals, values, counts, and both sample and population standard deviations.
• Interfaces optimized for client tools that enable you to set up Web service calls with
configuration only; no code is required. See Use InfoPath with PI Web Services (page 99)
for an example.
• A Web method that supports entry of PI Server data.
• Web methods that allow users to sign up for data updates (page 5).
• Support for Java-based applications, and Web service calls from non-Windows operating
systems.
• The ability to send and receive PI Web Services calls to and from PI or PI AF collectives
(page 10).
• Support for both synchronous and asynchronous calls when supported by the transport
and client proxy technology. As an example, .NET and Silverlight asynchronous clients
are fully supported.
• An option to host PI Web Services as a Microsoft Windows service (page 40), rather than
in Internet Information Services (IIS).
Features not supported are:
• Annotations. None of the IPITimeSeries Interface (page 77) methods contain a member
to store Annotation data, such as text, BLOB, and so on. Although the flag will show a
value of A when the value is annotated, the annotation data is not accessible.
• Use of the InsertPIData (page 80) method with a performance equation path or a PI AF
data reference path.
4
Summary of Features
PI Web Services 2010 R3 introduces Web methods that can retrieve changes to events that
occur after a Web services request is made. Changes to a PI System that make time series
data, PI points, or PI AF data references more current are known as updates.
In PI Web Services, updates are events that reflect changes in the data for the PI points or PI
AF data references named by the path included in the Web services call.
With the updates features, you can create Web service clients that return to the PI Server or
PI Asset Framework and retrieve updates that occur since the prior request, for a particular
path or collection of paths. For example, you might create a Web service client to implement
updated trends or revise calculations.
Updates are supported only on PI Server paths or PI AF paths that refer to simple PI point
data reference configuration, that is, data reference configurations that do not used advanced
settings such as time offsets or event weights. Updates are retrieved from the PI Server,
where they are stored as either snapshot values or archive events.
Updates in PI Systems typically consist of new events with time stamps later than the time
stamps of snapshot events. A PI System can, of course, accept addition and deletion of older
events. When this occurs, the Web service client will receive these older events as updates.
Updates are always snapshot or archive values, even if the sign-up occurred during a query
for interpolated or plot values data.
Explicit Sign-ups
Your application signs up explicitly for updates by passing one or more paths to the web
method SignUpForPIUpdates (page 83). If successful, this Web method returns a single
update ticket that represents sign-ups for all passed paths. If any passed path cannot support
updates, an error is returned for that path. If none of the passed paths can support updates,
SignUpForPIUpdates (page 83) will return a SOAP fault.
SignUpForPIUpdates (page 83) allows you to specify the expiration time of the signup. It is
not possible to specify an expiration time when using implicit signups.
Implicit Sign-ups
You can submit a data retrieval request for data and sign up for updates in a single operation.
This implicit signup occurs if you set the Updates property of a PIArcManner (page 87) or
PISummaryManner (page 89) object to TRUE for a call to GetPIArchiveData (page 77) or
GetPISummaryData (page 79), respectively. For paths that support updates, the Web method
returns the update ticket in the SeriesID property of each TimeSeries (page 92) object.
Note: Each update ticket obtained this way represents a signup for a single path passed
to GetPIArchiveData (page 77) or GetPISummaryData (page 79). To create an
update ticket that represents signups for multiple paths, you must use an explicit
(page 6) signup.
Implicit sign-ups for updates are supported only for data retrieval requests whose time range
ends in current time, or *. Updates always consist of all snapshot or archive values even if the
signup occurred during a query for interpolated, plot values or summary data.
6
Web Service Inputs
Path
<Source Designator>
A Web Service path (page 7) begins with one of three source designators to indicate what
type of data is used. The source designator of a path can be pi, pe, or af. Use pi to access PI
archive data, pe for PI performance equations, or af for data stored in PI Asset Framework.
Note: If you do not specify a server, but include pi only, the path will point to the default
PI Server for the machine hosting the Web service. For such a path to be valid,
you must include the <Source Designator> token. For example, pi:sinusoid.
<Server>
This second token of a Web Service Input path designates the server that contains the data
source and is:
• the server hosting the PI archive for pi
• the PI Server evaluating the performance equation for pe
• the PI AF database server for af
If there is no server token, queries that use the pi: designator (page 7) are sent to the PI
Server configured as the default server to which PI Web Services will connect. You can use
the PI Connection Manager to verify this setting.
The server used in the path must be valid: if the path contains the name of a PI Server that
exists and is running but is not in the Known Servers Table (KST), there are two possible
outcomes:
• If the PI SDK is configured to automatically add the names of valid PI Servers not
already in the KST (the default setting), PI Web Services will access data normally and
the PI Server name will be added to the KST for subsequent calls.
• If the PI SDK is not configured to automatically add the names of valid PI Servers not
already in the KST, you will get an error message (page 72).
<Path to Item>
The third token of a Web Service Input path is <Path to Item> which represents the type of
object that will be used, depending on which source designator is specified:
Source Designator Path to item format
pi: name of PI point
af: <database>\{<element>\}+|<attribute>[;uom]
, where the attribute token is a PI AF data reference to a
PI point or a scalar type and the optional UOM token
preceded by a semicolon is the string representing the
unit of measure in which to return the data. If the
attribute (or referenced PI point data) is stored in another
unit of measure, conversion will be attempted.
Examples
Some examples of PI Web Services input paths are:
pi:\\piserver1\sinusoid
pi:sinusoid
pe:\\piserver1\'sinusoid'*2
af:\\afserver1\PIDS01\PIWS01|piref1, where PIDS01 is a PI AF database and
piref1 identifies a PI AF attribute that is a reference to a PI point
af:\\afserver1\PIDS01\PIWS01|pi, where pi is an attribute whose value is the
constant 3.1415926535
af:\\afserver1\PIDS01\PIWS01|BoilingPoint; degree Fahrenheit,
where BoilingPoint is an attribute with a constant value of 100 º C
8
PI System Data Types
Constraint
Constraints define the data to be extracted from a data source that is referenced in a path
(page 7). Since the current implementation addresses only retrieval of time series data, the
only constraint type is the TimeRange (page 91).
PI Web Service calls can reference a single instance of time, provided a TimeRange (page 91)
with identical start and end times is used. For example, to reference current time, enter
StartTime=* and EndTime=* for the time range.
Times supported are ISO 8601 absolute times (page 12), and PI relative (page 11) and
absolute time (page 12) strings.
Manner
The Manner of data retrieval is a concept that can apply to any kind of data source. In
general, Manner is the way you provide details about how you want your data to be retrieved
and returned from PI Web Services, aside from Constraints (page 9). For example, when
retrieving Archive data, you need to specify the maximum number of data values to return
and whether results should be compressed or interpolated. When retrieving summary values,
you need to specify the summary type, that is, average, total, minimum, maximum, standard
deviation, and so on, and whether the summary should be time weighted or event weighted.
PI Web Services uses the PIArcManner (page 87) class and the PISummaryManner (page 89)
class to allow you to define retrieval manner.
To change the reporting level of logging, enable debug trace messages or add additional
destinations for messages, edit the PIInstrumentation.config file found in the root
directory (page 30) of the Web service. For details, see Logging and Instrumentation (page
119).
Deployments that use PI Web Services can write trace and error messages to the Windows
event log on the server hosting PI Web Services and the PI Message Log. You can also write
messages to the standard debug message window. This window can be read by Microsoft
Visual Studio or by the free DebugView application. Visit the Microsoft Web site to
download DebugView (http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx).
Time Stamps
In general, use strings to define time constraints in a data retrieval Web method. Use either
relative (page 11) or absolute (page 12) time.
With one exception (page 11), absolute (page 12) time strings are translated to PI System
internal time on the PI Web Services server, rather than the PI Server. As a result, the
translation might not occur as expected when:
• You assume that the PI Web Services server and the PI Server are in the same time zone,
but they are instead located in different time zones
• The transition to or from daylight savings time occurs (page 91)
To avoid ambiguity, use ISO 8601 time string format (page 12) and include the time zone
offset.
10
Time Stamps
There is an exception to the time input translation rule (page 10): when InsertPIData (page
80) is used, the time stamps of the data are used as the time inserted into the PI Server.
InsertPIData (page 80) takes a TimeSeries (page 92) array as input. All time stamps in this
array are defined as absolute time stamps in UTC format which translates to ISO 8601 UTC
when represented in XML as a string.
Time stamps returned by all PI Web Services methods are defined as absolute (page 12) UTC
time stamps in ISO 8601 UTC format. As a result, clients will typically determine the local
time zone and perform the desired conversion and will adjust for variations such as DST.
Relative Time
Relative time is a range of days, hours, minutes, or seconds. A single leading operator, either
+ or - , is required:
+/- d | h | m | s
The default starting point for relative time is usually the current time. For example, -8h is
eight hours before the current time. Fractional times such as -1.5d are supported.
Note: Multiple operators are not supported. For example, use -23h, not -1d+1h.
Absolute Time
Use caution with the default settings. Here are some examples of time stamps that might be
confusing.
8: 08:00:00 on the current date
:8 08:00:00 on the current date
::8 00:08:00 on the current date
:::8 00:00:08 on the current date
0:8 00:08:00 on the current date
The confusion comes from the ambiguity in the first two examples above. Following this
theme, when minutes are added to the next examples, the time stamps are still similar.
8:01 08:01:00 on the current date
:8:01 08:01:00 on the current date
12
Automatic WSDL Generation
The difference in the two notations is evident when a date is added to the time. When a date
is added to the front of the time the default notation is hh:mm:ss.ssss not :hh:mm:ss.ssss.
2 8: 08:00:00 on the 2nd of the current month
2 :8 00:08:00 on the 2nd of the current month
2 ::8 00:00:08 on the 2nd of the current month
If extra colons and times are added that is greater than the given DD-MMM-YY
hh:mm:ss.ssss format the last part of the time is disregarded.
2 :::8 00:00:00 on the 2nd of the current month
2 8:01:30 08:01:30 on the 2nd of the current month
2 :8:01:30 00:08:01 on the 2nd of the current month
A value for the seconds must be used if sub-seconds are used. Hence use caution when
considering time stamps containing sub-seconds.
8::30.01 08:00:30.0100 on the current date
:8::30.01 08:00:30.0100 on the current date
14 :8::30.01 00:08:00 on the 14th of the current month
Before Installation
Complete these tasks before you run the PI Web Services installation program:
• Verify the system you plan to use has the user accounts required (page 51) for PI Web
Services.
• Verify that the server you plan to use:
ο Meets the system requirements (page 16).
Note: Prior to installation, the PI Web Services setup kit (page 15) will verify that
your server fulfills the system requirements (page 16). The installer will exit if
any components are missing.
ο Uses Microsoft Internet Information Services (IIS) for Windows Server. For details,
see Configure the Web Server (page 18).
ο Meets the setup requirements described in Host PI Web Services on a PI WebParts
Server (page 17) if the server on which you install PI Web Services also runs PI
WebParts.
• Before you use PI Web Services, you must designate a Web site to host PI Web Services:
ο You can set up this Web site when you install PI Web Services by selecting the
location of the Web site's root directory and naming its virtual directory, or selecting
the default.
ο To customize the root directory, use the IIS Manager Add a New Web site feature
before you install PI Web Services.
ο Verify that the Web server that hosts the Web site has folder and registry permissions
(page 71) that are compatible with PI Web Services.
• To run the setup kit (page 27):
ο If you install PI Web Services 2010 R3 on Microsoft Windows Vista, Windows 7, or
Windows Server 2008, you must be logged in as an administrator.
ο .NET Framework 4 must be installed. See Install .NET Framework 4 (page 17) for
details.
ο IIS must be enabled to use the Windows features described in Configure the Web
Server (page 18).
System Requirements
The PI Web Services setup kit checks for the minimum requirements listed here. If the PI
Web Services setup kit cannot verify these requirements, the installation will fail.
The server you use to install PI Web Services must be running:
• Windows Server 2008 R2, Microsoft Windows Server 2008 with Service Pack 2,
Windows Server 2003 with Service Pack 2, or Windows Server 2003 R2, Windows
Vista, Windows 7
• Internet Information Services (IIS) for Windows Server, version 6.0 or later.
Note: Although you can install either the 32-bit or 64-bit version of PI Web Services
on a 64-bit computer, OSIsoft recommends that you always run IIS as a 64-bit
process if you use a 64-bit Web server.
Note: If the server you use also runs PI WebParts, see Host PI Web Services on a PI
WebParts Server (page 17).
See Secure Access to PI Server Data (page 48) and Secure Access to Data through PI Asset
Framework (page 51) for information about how to configure security settings on these
servers.
16
Before Installation
Note: End users who access data through PI Web Services require specific permissions
(page 71) to Web site folders, subfolders and a registry key.
If you want to host PI Web Services 2010 R3 on a Web server that has PI WebParts installed,
OSIsoft recommends that you:
• Create an IIS Web site and associated application pool that are not under the control of
Microsoft SharePoint. The Web site should be configured on its own port number. You
must select the Web site as the host when you run the setup kit (page 27).
• Verify that the application pool you set up for PI Web Services runs under a Process ID
that is different from the Process ID used for PI WebParts.
PI Web Services is hosted by Microsoft Internet Information Services (IIS) for Windows
Server. The server on which you install PI Web Services must have, at a minimum, these
required features:
ο ASP.NET
ο .NET Extensibility
ο ISAPI Extensions
ο ISAPI Filters for .NET Framework 4
If you are using Windows 7 (page 23), you must also turn on:
ο Default Document
ο Static Content
Note: If the server you use does not have these IIS features activated, the setup kit will
fail. If ISAPI Filters are not enabled for .NET Framework 4, you will be unable to
use PI Web Services.
Refer to these topics for details about how to configure IIS, based on the Windows operating
system version.
18
Before Installation
a. Click Allow.
b. Select All Unknown ISAPI Extensions and click Allow:
c. Review the IIS Manager alert about the potential security risk.
d. Click Yes.
e. Verify that ASP.NET v4.0.xx and All Unknown ISAPI Extensions are Allowed:
2. Continue with the configuration (page 20) for PI Web Services on Windows Server 2003.
20
Before Installation
e. Verify that Internet Information Services Manager and World Wide Web Service
are selected in Internet Information Services (IIS):
f. Select World Wide Web Service in Internet Information Services (IIS) and click
Details.
g. Verify that World Wide Web Service is selected in World Wide Web Service:
22
Before Installation
b. Right-click on the Web server in the Connections pane to verify that the .NET 4
Framework extension is included in the list of ISAPI extensions and that the
restrictions are set to Allowed:
a. Click OK.
6. Verify that a .NET 4 Framework is enabled:
a. In Control Panel:
− For Windows 7, click System and Security, and then click Administrative
Tools.
− For Vista, click System, and then click Administrative Tools.
b. Double-click Computer Management, and then click to expand Services and
Applications and then click Internet Information Services.
c. Double-click ISAPI and CGI Restrictions.
d. Select the machine on which PI Web Services will be hosted.
e. Review the ISAPI and CGI Restrictions and verify that ASP.NET v4.x is included.
24
Before Installation
g. Enter the path to the Microsoft .NET directory containing the file
aspnet_isapi.dll, a description and select Allow extension path to execute:
h. Click OK.
7. Select Application Pools under Connections, and review the Identity column to verify
that the IIS Web server allows connections to .NET 4 Framework and that the application
pool identity (page 51) is set to NetworkService.
a. To change the identity, right-click DefaultAppPool and select Advanced Settings:
26
Run Setup Kit
Note: If you run the PI Web Services setup kit on a 64-bit Windows server, it will
install the PI SDK for both the 32-bit and 64-bit operating systems.
a. During the PI Software Development Kit (PI SDK) installation, enter the appropriate
information when you are prompted for:
− user information
− a path to a folder where PI SDK will be installed
− names for a default user and a default PI Server
Note: It is possible to buffer data sent to the PI Server to guard against loss of
connection. Data are not buffered by default. To enable buffering, use the PI
SDK Utility. See the PI SDK Utility Help for details.
d. During the PI AF client setup, enter the name of the AF server to which you want PI
Web Services to connect.
− You might be asked to provide the name of a PI Server for storage of Module
Database configuration data. You can test this using PI SMT.
e. Click Install to start the PI AF client installation.
f. Click Finish to complete the PI AF client installation.
g. During the installation of PI Web Services, use the Select Installation Address
dialog to select:
− Site: A Web site location to host the Web site content and Web service files used
by Internet Information Services (IIS) on Windows Server. By default, this file
tree is stored in [wwwroot]\PIWebServices (page 30).
− Virtual directory: A name for the IIS virtual directory. The default value is
PIWebServices.
− Application Pool: The Application Pool within the Internet Information Services
Web server where PI Web Services runs.
− Installation directory: If this is a new installation, you have the option to select
a path to an installation folder for PI Web Services. If you are upgrading PI Web
Services, the upgrade is installed in the folder used for the previous installation.
Note: You can only choose a new installation directory if you install PI Web Services
2010 R3 for the first time. If you upgrade, the setup kit installs PI Web
Services in the directory used for the earlier version.
After Installation
After PI Web Services is installed, you can:
• Test the Web Server connection (page 29).
• Verify that PI Web Services files (page 30) are installed.
• Verify (page 32) PI Web Services can retrieve PI System data.
• Customize the setting (page 37) that controls the size of messages sent and received
between a Web client and Web server
• Review and update your security settings (page 38).
• Verify that your firewall (page 39) allows PI Web Services to communicate with your PI
System.
• Configure settings (page 39) that determine whether PI data insertions and performance
equations are allowed, and how data is displayed.
28
After Installation
Use a browser such as Windows Internet Explorer to verify your installation for data retrieval
from PI Server and PI AF:
• If you used the default installation and Web site directories, enter:
http://localhost/PIWebServices/PITimeSeries.svc
If you did not use the default installation and Web site directories, enter the path you used for
the Web site relative URL:
• http://[servername]:[portnumber]/[PIWebServices directory name]/PITimeSeries.svc
You should see this page:
Locate the directory used for your installation and review its contents to confirm that the PI
Web Services files (page 31) were installed correctly. This directory location will differ if:
• PI Web Services 2010 R3 is installed for the first time. Look in [PIHOME]\PIPC\PI
Web Services.
• You upgrade to PI Web Services. Look in the Web server root directory for the Web site
used to host the Web site content and service files used by Internet Information Services
(IIS) on Windows Server. By default, this file tree is stored in
C:\inetpub\wwwroot\PIWebServices. This Help refers to this directory as
[wwwroot].
Note: You can point to an existing Web site to host PI Web Services content and select
the location of its root directory when you run the PI Web Services installer. The PI
Web Services files are installed in the directory chosen during installation.
30
After Installation
Note: PIWebServices is the default name of the IIS virtual directory. You can select
another name for this directory when you install PI Web Services. If another name
is selected, this virtual directory name is different.
A Web service client application is required to verify whether PI Web Services can retrieve
PI System data. There are several third-party applications available that do not require
programming to verify that data is being passed through PI Web Services. This section shows
how to use WCFStorm, a Windows Web services client application.
Note: This example is provided to illustrate the process for configuring such tools for use
with PI Web Services. OSIsoft does not endorse WCFStorm as a development
tool or warrant its use or operation. To download a trial version or shareware
version of this tool, see the WCFStorm Web site
http://www.wcfstorm.com/wcf/home.aspx.
Use the procedure here to perform a basic test whether PI Web Services is retrieving snapshot
data.
32
After Installation
3. WCFStorm will retrieve the metadata from the Web service and display the endpoint and
its methods:
4. Click on Config on the menu bar and change the Impersonation level to Delegation in
the Authentication or Security tab:
Note: PI Web Services requires the client to authorize delegation of the user's Windows
identity. By default, WCFStorm authorizes impersonation but you must change the
impersonation level used by WCFStorm to Delegation as described in Step 4.
34
After Installation
5. Review the parameters for your request that appear in the Request panel:
6. Click the Green arrow button to the left of the request to send the request to PI Web
Services.
7. If PI System data appears in the Response panel, PI Web Services is correctly installed
and able to retrieve PI System data:
Note: The XML shown by WCFStorm when the View as XML is selected does not
reflect the actual structure of PI Web Services messages and should not be used
as the basis for constructing messages in script clients.
Note: For other versions of IIS, see the MSDN article How to: Configure an HTTP
Handler Extension in IIS http://msdn.microsoft.com/en-us/library/bb515343.aspx.
e. Click OK.
Note: Alternatively, you can use the Microsoft command-line utility serviceModelReg to
create the handler mapping. First, verify that the file serviceModelReg.exe is
in Windows\Microsoft.NET\v4.0.xx\Framework\ or
Windows\Microsoft.NET\v4.0.xx\Framework64\.
36
After Installation
The WCF configuration parameter maxReceivedMessageSize allows you to control the size
of messages sent and received between a Web client and Web server. PI Web Services does
not alter this parameter's default value of 65,536 bytes, but your system may reach this limit
and receive an error (page 73) if PI Web Services is used to insert or retrieve large amounts
of data.
This parameter is configured in the web.config
(http://msdn.microsoft.com/en-us/library/aa306178.aspx) file located
in the PI Web Services installation directory (page 30):
• If the computer was upgraded to PI Web Services 2011, see the Web application folder,
[wwwroot] (page 30)\PIWebServices
• For computers on which PI Web Services 2001 is a new installation, see
[PIHOME]\PIPC\PI Web Services.
To change this limit, add the message size binding element (page 37) to the web.config
file and set the appropriate message size (page 38). If you are using .NET applications, set
maxReceivedMessageSize in both the app.config and web.config files; in this case
app.config controls the size of the message received by the client and web.config
controls the size of the request message received by the service.
Each PI Web Services sample web.config files includes the maxReceivedMessageSize
parameter set to the default value of 65,536 bytes (64 KB). If you are using one of these files,
change the value of the existing parameter to set the appropriate message size (page 38).
PI Web Services uses configuration files that include Windows Communication Foundation
(WCF) bindings to specify how data is sent across the network. To secure your Web service
applications, you must edit these bindings to determine how data is transported and encoded,
and specify how data is protected and represented, as well as how clients and servers
communicate securely.
PI Web Services includes five sample configuration files, each with a different binding type,
to help you get started with your security setup. You can use these sample bindings to set up
the security for your PI Web Services deployment, or to better understand how to use your
own binding files.
38
After Installation
To determine which binding is appropriate for your PI Web Services, you must consider:
• The types of clients to be supported
• Whether you want binary or XML representation on the wire
• Security requirements
For instructions on how to use the PI Web Services sample bindings and for other security
recommendations, see PI Web Services Security (page 47).
The network ports that PI Web Services uses to communicate with your PI System must be
open. If you have any internal firewalls (page 68) between the PI Web Services server and
the PI or AF Servers, verify that the appropriate TCP ports are open, or configure exceptions
to open the appropriate ports (page 69).
PI Web Services includes three custom properties you can use to control these client
application features:
• Data value displays (page 40)
• Performance equation execution (page 40)
• PI System data insertions (page 40)
• Duration of update sign ups (page 40)
The settings described here are found in the PIWebServiceSettings element of the
web.config file:
<PIWebServiceSettings>
<add key="AllowCalculations" value="true" />
<add key="AllowDataEntry" value="true" />
<add key="FloatPrecision" value="Full"/>
<add key="UpdatePurgeInterval" value="5"/>
</PIWebServiceSettings>
The web.config (http://msdn.microsoft.com/en-
us/library/aa306178.aspx) file is found in the appropriate Web application folder,
depending on the location of the PI Web Services installation files (page 30).
40
Host PI Web Services with a Windows service
Note: You may install just one edition of PI Web Services on a single server. To change
from one edition to another, you must first uninstall the existing edition. If you have
IIS installed on your server, you must uninstall it before you run the PI Web
Services Standalone Edition setup kit.
The PI Web Services 2010 R3 Standalone Edition is bundled with the PI Web Services 2010
R3 setup kit and requires that the following be installed on the server that you use to install PI
Web Services:
• Windows Server 2008 R2, Microsoft Windows Server 2008 with Service Pack 2,
Windows Server 2003 with Service Pack 2, or Windows Server 2003 R2, Windows
Vista, Windows 7
• .NET Framework 4. To download, go to http://www.microsoft.com/net.
The computer must also have network access to one or more of these OSIsoft servers:
• PI Server 3.3 or later
• PI AF Server 2.1 or later that includes PI SQL for AF Server (page 17)
See Configure Security for PI Web Services Standalone Edition (page 42) and Impersonation
and delegation (page 57) for information about how to configure security settings.
Note: If you run the PI Web Services setup kit on a 64-bit Windows server, it will
install the PI SDK for both the 32-bit and 64-bit operating systems.
a. During the PI Software Development Kit (PI SDK) installation, enter the appropriate
information when you are prompted for:
− user information
− a path to a folder where PI SDK will be installed
− names for a default user and a default PI Server
Note: It is possible to buffer data sent to the PI Server to guard against loss of
connection. Data are not buffered by default. To enable buffering, use the PI
SDK Utility. See the PI SDK Utility Help for details.
When you host PI Web Services with a Windows service, you must reserve a namespace to
instruct the operating system to route HTTP traffic for a specific URL to the service. To do
so, you must use a command-line tool provided by Microsoft to invoke the HTTP Server API.
For complete details, see Configuring HTTP and HTTPS (http://msdn.microsoft.com/en-
us/library/ms733768.aspx).
For information about how to secure connections between a PI System and a PI Web Services
client, see PI Web Services Security (page 47).
42
Host PI Web Services with a Windows service
where url is the URL and acl is a Security Descriptor Definition Language (SDDL) string
that provides owner and access specifications. A sample command line reserving a URL for
PI Web Services on port 8000 and giving the Network Service generic access is:
HttpCfg.exe set urlacl /u http://myserver:8000/PIWebServices /a
D:(A;;GA;;;NS)
For details on the SDDL format, see Security Descriptor String Format
(http://msdn.microsoft.com/en-us/library/aa379570(v=VS.85).aspx).
To verify that PI Web Services 2010 R3 Standalone Edition was installed successfully:
• If you install PI Web Services for the first time, verify that the PI Web Services file
directory (page 30) contains:
ο OSIsoft.PIDataServices.Common.dll
ο OSIsoft.PIDataServices.Configuration.dll
ο OSIsoft.PIDataServices.DataAccess.dll
ο OSIsoft.PIDataServices.DataService.dll
ο OSIsoft.PIInstrumentation.dll
ο OSIsoft.PIInstrumentation.InstallState
ο OSIsoft.PIInstrumentation.Listeners.dll
ο PIInstrumentation.config
ο PIWebServices.dll
ο PIWebServicesIInstrumentation.dll
ο PIWebServicesIInstrumentation.InstallState
ο PIWebSvcHost.exe
ο PIWebSvcHost.exe.config
ο PIWebSvcHost.InstallState
To verify data access:
1. Start the PI Web Services service.
2. Open the app.config that is installed with the standalone edition to see the URL for the
base http site, then enter this URL into a browser such as Windows Internet Explorer.
3. To verify your installation for data retrieval from PI Server and PI AF:
ο If you used the default installation and Web site directories, enter:
http://server:8000/PIWebServices/TimeSeries
If you did not use the default installation and Web site directories, enter the path you used
for the Web site relative URL:
ο http://[servername]:[portnumber]/[virtual directory
name]/TimeSeries
4. To verify your installation for searches of PI Server data:
ο If you used the default installation and Web site directories, enter:
http://server:8000/PIWebServices/Search
ο If you did not use the default installation and Web site directories, enter the path you
used for the Web site relative URL:
http://[servername]:[portnumber]/[PIWebServices directory
name]/Search
44
Silent Installation of PI Web Services
If you would like to run the PI Web Services installer without a graphical user interface
(GUI), you can use the silent installer that is included with the PI Web Services setup kit:
1. Double-click the PI Web Services setup kit.
2. De-select the option When done unzipping open: .\Setup.exe, click Browse to locate a
folder where you want to extract the installation files for PI Web Services and click
Unzip.
3. Open the file setup_silent.ini and:
a. Edit line 5 to replace MyServer with the name of the default PI Server and
pidemo with the name of the default user:
5 = /qn PI_SERVER=MyServer PI_TYPE=3 PI_USER=pidemo ALLUSERS=1
REBOOT=Suppress NOPISDKBUFFERING=1
b. Proceed to Step 5 if you do not want to create a file that specifies a list of PI Servers
in the Known Servers Table (KST).
4. To create a file to specify a list of PI Servers in the Known Servers Table (KST):
a. Comment out this line:
7 = /qn ALLUSERS=1 REBOOT=Suppress PI_SERVER=MyServer
PI_USER=pidemo REBOOT=Suppress
Note: The 64-bit version of PI SDK will use the information from line 5, so you do not
need to include this line.
Note: If you run the PI Web Services setup kit on a 64-bit Windows server, it will
install the PI SDK for both the 32-bit and 64-bit operating systems.
46
Chapter 3
Windows-integrated Security
48
Secure Access to PI Server Data
Improved Security:
Secure authentication. Connections are authenticated through Microsoft's Security
Support Provider Interface (SSPI). If you're using AD, then this means the most secure
Kerberos authentication, which greatly improves your PI Server security.
Control over server-side authentication policies. With the new security model, you
have control over the authentication protocols that client applications can use to connect
to the PI Server. You can disable authentication methods that are less secure and keep
only the connection methods that you need.
More control over access permissions. The security model included with PI Server 3.4.380
and later includes a much more flexible model for access permissions. In previous versions of
the PI Server you could set permissions only for one owner, one user group, and for world
access (everyone else). With this security model, each PI Server resource can have read
and/or write permissions defined for any number of PI identities (page 49).
Note: OSIsoft recommends that you map both the User ID and the Process ID
accounts (page 51) to two distinct PI Identities.
For further details, see Configuring PI System Security and the PI SMT Help, available at the
OSIsoft Technical Support Web site (http://techsupport.osisoft.com).
PI Trusts
For further details, see Configuring PI System Security and the PI SMT Help, available at the
OSIsoft Technical Support Web site (http://techsupport.osisoft.com).
Users of PI Web Services require read and write access to PI Server databases to accomplish
various tasks. The permissions summarized here allow Web services users to create and edit
PI points and modules, retrieve and insert PI Server data, and so on. PI MDB access is
required because PI Data Services (page 6) uses it to store configuration information.
Note: Additional permissions are required to run the setup kit (page 27).
PIBatch r
PIDBSEC r
PIHeadingSets r
PIUSER r
PtSecurity r
DataSecurity r,w w for the User ID only if data writes are performed
using the InsertPIData method
Use PI System Management Tools (PI SMT) to change these permissions. For complete
details, see the PI SMT Database tool Help.
50
Secure Access to Data through PI Asset Framework
To ensure that both of these accounts allow PI Web Services to connect with a PI System:
• PI Web Services will use a secure configuration if the IIS Web server uses Network
Service for its application pool identity (page 52).
• Verify your identity connections (page 52). If the IIS Web server uses a domain account
other than Network Service, you must configure Kerberos authentication (page 52).
• Connections that use Windows authentication (page 52) must meet additional
requirements.
• End user folder and registry permissions (page 71) must be set to allow access to data
stored in the PI Server, PI Module Database (MDB) and PI point database.
Note: If you open IIS Manager from a remote connection, the NetworkService
account is visible in IIS Manager as the machine's name.
2. Use PI SMT to inspect the PI identity to which the Windows account is mapped.
3. To verify that these identities will allow PI Web Services connections, see Connections
that use Windows Authentication (page 52), or Connections that Kerberos Authentication
(page 52).
• The client, Web server, PI Server and AF Server machines all belong to the same Active
Directory forest.
Caution: In most cases, the Web server will impersonate the User ID so that access to
the PI System takes place using the Windows account of the client. If
impersonation fails or is not configured, access to the PI System will take place
using the Process ID. OSIsoft recommends that the Process ID account not be
granted write access to the PI System.
52
Configure Secure Web Service Access
End user groups and the application pool identity require the following folder and registry
permissions on the Web server:
Location User Permissions Notes
Account
Web site folder and subfolders User ID Read & The Web site folder which is typically
Execute, stored in [wwwroot] (page
Read 30)\PIWebServices
Web site folder and subfolders Process ID Full Control The Web site folder which is typically
stored in [wwwroot] (page
30)\PIWebServices
HKLM\SOFTWARE\PISystem User ID, Full Control Allows PI Web Services to access the
registry key and subkeys Process ID Known Servers Table and time zones in
registry.
Note: The permissions described here are set automatically when you enable IIS using
the default settings. If you are not using the default IIS settings, you might need to
change permissions to reflect these requirements.
Note: Client security configuration depends on the particular client tool used. For .NET
applications, this is accomplished in the app.config file. For an example, see
Configure Security for .NET Clients (page 61).
To secure your PI Web Services deployment, you must set values for security on each Web
service binding. Binding details must be the same for both clients and endpoints (page 56) to
ensure data exchanges are successful.
These security settings are preconfigured in the sample configuration files (page 62) included
with PI Web Services.
Before you create Web service bindings, you must select a binding type. There are four
binding types that can be configured for PI Web Services. To understand more about how
these files, see the sample configuration files (page 62) provided with PI Web Services for
each binding type.
To decide which binding to use, consider the type of security used for your PI System data.
If you use Windows-integrated security for your PI Server and AF Server, you can use any of
these binding types:
• wsHttpBinding (page 55)
• netTcpBinding (page 55)
• netNamedPipeBinding (page 55)
When configured for security, these bindings allow you to control user access to PI data
through the mappings and identities; with them you can identify and control which users log
in and access PI data.
A fourth option is basicHttpBinding (page 54).
After you select the binding type, you can configure security for the Web service bindings
(page 55).
This section provides brief guidelines to help you select a binding type. For more information
about which type of binding is best suited to your purposes, see the MSDN articles Bindings
and Security http://msdn.microsoft.com/en-us/library/ms731172.aspx and Configuring
System-Provided Bindings http://msdn.microsoft.com/en-us/library/ms731092.aspx.
basicHttpBinding
This is the SOAP 1.1/WS-Interoperability Basic Profile binding. It is not secure by default.
Security mode options are:
• None
• Transport
• Message
• TransportWithMessageCredential
The basicHttpBinding in WCF is provided for compatibility with WS-Interoperability Basic
Profile clients and by default provides no security. WS-I Basic Profile compliant applications,
such as Microsoft Office InfoPath (page 99), will require the basicHttp binding.
54
Configure Secure Web Service Access
OSIsoft recommends Transport security with a Windows token as the client credential in
order to protect the exchange and provide Windows credentials for impersonation (page 57).
PI Web Services includes a basicHttpBinding sample (page 63) that you can use with
minimal configuration.
wsHttpBinding
This is the SOAP 1.2 binding. This binding is secure by default. The PI Web Services setup
kit configures the Web service for this binding based on the assumption that the application
pool is running under the Network Service (page 52) account.
Web service clients that support profiles above the WS-I Basic level, such as custom clients
written with .NET or Java frameworks should use wsHttpBinding. This binding uses
impersonation and delegation (page 58) by default, so only minimal configuration changes
are required.
If you are using Windows authentication (page 52), and want to use impersonation and
delegation (page 58), this binding requires minimal edits. PI Web Services includes a sample
wsHttpBinding (page 64) that you can also use with minimal configuration.
netTcpBinding
This is a non-SOAP, binary format binding. It can be used between machines. TCP/IP is the
transport protocol. It is a secure binding optimized for cross-machine communication on an
intranet between WCF clients and WCF Web servers. The netTcpBinding sample (page 62)
included with PI Web Services is configured for secure operation provided you replace the
server name placeholder with the actual machine name in the servicePrincipalName XML
element.
netNamedPipeBinding
This is a non-SOAP, binary format binding that is restricted to use on a single machine.
Named Pipes is the transport protocol. PI Web Services includes a sample
netNamedPipeBinding (page 67) that you can use with minimal configuration. If you use this
netNamedBinding sample (page 62) as is, the netNamedPipeBinding will perform Windows
authentication but does not encrypt the data in transit.
PI Web Services provides sample configuration files (page 62) pre-configured with
recommended settings that are intended to streamline the changes you must make to the
web.config file in the PI Web Services file directory (page 30). If your IIS server is set up
as described in Configure the Web Server (page 18), you need change only the
servicePrincipalName value to reflect the name of the server that hosts PI Web Services to
use these sample configuration files.
If you use your own web.config file, or want to edit the sample files to meet the needs of
a custom Web services deployment, refer to the topics here. To make changes to the default
settings in web.config that are not described here, see the MSDN article Windows
Communication Foundation Security http://msdn.microsoft.com/en-
us/library/ms732362.aspx.
Note: There is no administration tool provided by the operating system to manage WCF
settings found in web.config (http://msdn.microsoft.com/en-
us/library/aa306178.aspx). You can use a text editor or WCF Service
Configuration Editor (page 68) to edit these files.
Note: Do not change the endpoint that begins with <endpoint address="mex." This
is the Metadata Exchange Endpoint and is used by WCF to expose information
about PI Web Services such as the WSDL (page 13) to certain newer client
applications.
56
Configure Secure Web Service Access
Note: To use the netTcpBinding (page 65) with PI Web Services, you must be running
Internet Information Services (IIS) on Windows Server 7 or later.
Note: For further information about best practices for this configuration, see the MSDN
Web site for articles about trusted subsystems http://msdn.microsoft.com/en-
us/library/ff649178.aspx.
58
Configure Secure Web Service Access
You can generate an app.config file with almost all of the necessary WCF configuration
for PI Web Services applications built with .NET and Visual Studio by creating a Web
service reference, then providing Visual Studio with the URL to the WSDL (page 13)
endpoint for the deployed Web service. This URL is:
http://server_name/PIWebServices/PITimeSeries.svc?WSDL, if you use
the installation defaults.
One critical item that Visual Studio cannot generate, however, is the level of impersonation
authorized by the client. This level, set by the allowedImpersonationLevel attribute,
indicates the level of impersonation that the client authorizes the Web server to use on its
behalf. The possible values are:
• None
• Anonymous
• Identification
• Impersonation
• Delegation
PI Web Services requires a delegation level to function properly in a secured environment.
This level only can be configured for wsHttp and netTcp bindings. To accomplish this level
of authorization, .NET client developers should take these steps:
1. Generate a Web service reference as described in this MSDN article: How to: Generate a
Web Service Proxy http://msdn.microsoft.com/en-us/library/bbs97dkt(VS.90).aspx.
2. Add an endpoint behavior authorizing delegation that references the new behavior from
the client endpoint:
a. Open the newly created app.config file in Visual Studio and add the following
section of XML as a child of the system.serviceModel element and as a peer of the
bindings element:
<behaviors>
<endpointBehaviors>
<behavior name="wsImpersonationBehavior">
<clientCredentials>
<windows
allowedImpersonationLevel="Delegation" />
<httpDigest impersonationLevel="Delegation"
/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
Note: Name the behavior as desired. This example uses the name
wsImpersonationBehavior.
This section describes how to use the Web Service bindings included in the sample
web.config files to configure secure PI Web Services deployments. There is one fully
configured web.config file for each supported WCF binding type (page 54).
You can use a text editor or WCF Service Configuration Editor (page 68) to edit these files.
62
Configure Secure Web Service Access
basicHttpBinding Sample
The sample basicHttpBinding (page 62) web.config provided has the setting <security
mode="none">. Use this binding when it is required to communicate with SOAP 1.1 clients,
such as InfoPath (page 99).
Note: To protect your data exchanges and provide Windows credentials for
impersonation, OSIsoft recommends you use Transport security. In the
basicHttpBinding, Transport security requires the host IIS server to be configured
with a certificate and enabled for HTTPS. The sample provided with PI Web
Services uses None security because signed certificates are site-specific and
must be generated by your Public Key Infrastructure (PKI).
Note: The name of the binding – basicBindingConfig – is used as the value of the
endpoint's bindingConfiguration attribute to link this configuration to the endpoint.
For secure communications, the web.config file for the service must authenticate the client
using a certificate under this mode. A service behavior that accomplishes this is as follows:
<serviceBehaviors>
<behavior name="BasicSecuredSvcBehavior" >
<serviceMetadata httpGetEnabled="true"
httpsGetEnabled="false" />
<serviceCredentials>
<serviceCertificate findValue="d5 04 7e e0 c9 30 fb 53 50
26 0b 74 84 e1 35 aa 56 c6 5f a1" storeLocation="LocalMachine"
x509FindType="FindByThumbprint" />
<windowsAuthentication includeWindowsGroups="true"
allowAnonymousLogons="false" />
<issuedTokenAuthentication
allowUntrustedRsaIssuers="false" /
</serviceCredentials>
<serviceAuthorization
principalPermissionMode="UseWindowsGroups"
impersonateCallerForAllOperations="true" />
</behavior>
</serviceBehaviors>
For additional security, you can require client applications to supply a certificate by adding a
clientCredentials section to the service behavior, and thereby provide for mutual
authentication.
Note: This example includes a findValue setting that uses the thumbprint of a certificate.
For more information about the certificates used in this security setting, see this
MSDN article on service credential http://msdn.microsoft.com/en-
us/library/ms731340.aspxcertificates (http://msdn.microsoft.com/en-
us/library/ms731340.aspx).
wsHttpBinding Sample
To configure the wsHttpBinding sample to provide a secure connection suitable for user
impersonation and delegation over the HTTP protocol:
1. Add a section for wsHttpBinding. While most of the settings shown here are defaults,
ensure security mode is Message and message clientCredentialType is Windows:
<wsHttpBinding>
<binding name="wsBinding"
bypassProxyOnLocal="false"
transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Text"
textEncoding="utf-8"
useDefaultWebProxy="true"
allowCookies="false">
<reliableSession ordered="true"
inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default"
establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
2. Create an endpoint where:
a. The binding attribute denotes that wsHttpBinding is the binding type.
b. The bindingConfiguration attribute names the binding configuration created in Step
1.
64
Configure Secure Web Service Access
c. The servicePrincipalName under identity refers to the name of the machine hosting
the Web service:
<endpoint binding="wsHttpBinding"
bindingConfiguration="wsBinding"
name="BasicEndpoint"
bindingNamespace=http://xml.corporate.com/services/PIDataService
contract="PIWebService.PIDataService.IPITimeSeries">
<identity>
<servicePrincipalName value="HOST/server_machine_name" />
</identity>
</endpoint>
d. In the serviceBehaviors section, ensure the behavior configuration used by the Web
service has TRUE for the value of impersonateCallerForAllOperations.
<serviceBehaviors>
<behavior name="PIDataService.Service1Behavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceCredentials>
<windowsAuthentication includeWindowsGroups="true"
allowAnonymousLogons="false" />
<issuedTokenAuthentication
allowUntrustedRsaIssuers="true" />
</serviceCredentials>
<serviceAuthorization
principalPermissionMode="UseWindowsGroups"
impersonateCallerForAllOperations="true" />
</behavior>
</serviceBehaviors>
netTcpBinding Sample
Note: To use the netTcpBinding with PI Web Services, you must be running Internet
Information Services (IIS) on Windows Server 7 or later and the Windows
Activation Service (WAS) feature must be installed for use with non-HTTP
requests.
To configure the sample netTcpBinding with PI Web Services hosted under IIS:
1. Verify that Windows Activation Service (WAS) for use with non-HTTP requests is
installed:
In the Control Panel click Programs and Features > Turn Windows Features on and
off > Microsoft .NET Framework 3.x and verify that Windows Communication
Foundation Non-HTTP Activation is selected.
2. Configure the Web site that hosts PI Web Services to listen for netTcp requests:
Log in as administrator then open a command prompt and enter:
%windir%\system32\inetsrv\appcmd.exe set app "Default Web
Site/PIWebServices" /enabledProtocols:http,net.tcp
Note: The command above assumes the Web site hosting PI Web Services is the
default Web site.
bindingNamespace="http://xml.corporate.com/services/PIDataService"
contract="PIWebService.PIDataService.IPITimeSeries">
<identity>
<servicePrincipalName
value="HOST/server_machine_name" />
</identity>
</endpoint>
5. Modify the servicePrincipalName to reflect the machine name of the Web server
hosting PI Web Services.
6. Ensure the service behavior enables impersonation (page 58) for all operations.
If you are using IIS 7.0, you can use IIS Manager to configure the netTcpBinding:
1. Select the Web site that hosts PI Web Services.
2. Right-click and select Edit Binding... Add netTcp.
3. Add the port you want to use for netTcp and *, for example, "808:*".
4. Under the PI Web Services application, right-click the application, then select Advanced
Settings..... Under the Behavior section, ensure netTcp is listed under Enabled
Protocols.
Note: If more than one protocol is enabled, such as the case when metadata is
exposed over HTTP, enabled protocols are in a comma-delimited list with no
spaces between the comma delimiter and the protocol. For example,
"http,netTcp". Verify that no spaces appear in the list.
66
Configure Secure Web Service Access
netNamedPipeBinding Sample
To use the netNamedPipeBinding with PI Web Services, you must be running Internet
Information Services (IIS) on Windows Server 7 or later and the Windows Activation Service
(WAS) feature must be installed for use with non-HTTP requests. To check this setting, go to
Windows Features > Microsoft .NET Framework 3.0, and verify that Windows
Communication Foundation Non-HTTP Activation is selected.
To configure the Web site hosting PI Web Services to listen for netNamedPipe requests:
1. From a command prompt with administrator privileges, run the command:
%windir%\system32\inetsrv\appcmd.exe set app "Default Web
Site/PIWebServices" /enabledProtocols:http,net.pipe
Note: The command line above assumes that the Web server uses the default IIS
Web site to host PI Web Services.
Note: If more than one protocol is enabled, such as the case when metadata is
exposed over HTTP, enabled protocols are in a comma-delimited list with no
spaces between the comma delimiter and the protocol. For example,
"http,netpipe". Verify that no spaces appear in the list.
Firewall Security
Firewalls within your LAN, whether dedicated hardware devices or software firewalls such as
the one implemented in the Windows operating system, must be configured properly to pass
data through the PI Web Services server and your PI Servers and AF Servers.
If you have any internal firewalls between the PI Web Services server and the PI or AF
Servers, verify that the appropriate TCP ports are open, or configure exceptions to open the
appropriate ports (page 69).
Whenever possible, limit firewall exceptions that allow data passage to known networks and
IP addresses.
68
Firewall Security
This topic describes firewall settings for the servers hosting PI Web Services and your PI
Server or AF Server.
Because of the underlying technologies that PI Data Services (page 6) uses to communicate
with PI System servers, some ports must be open on the firewall to allow incoming TCP
connections.
To use a firewall that blocks unauthorized access, but allows PI Web Services to
communicate with your data servers, OSIsoft recommends these firewall exceptions:
Machine Open these Firewall Ports:
IIS Web Server hosting PI Web Any TCP ports used by applications that transmit data
Services across the Internet; PI Web Services supports these
protocols:
HTTP, typically port 80
HTTPS, typically port 443
netTcp, typically site-specific
PI Server 5450
PI AF Server, version 1.x 5454 and 5455
PI AF Server, version 2.x, 2010 or later 5457 and 5459
To verify whether there are additional ports were added since this version of PI Web Services
was released, see What Ports need to remain open in a firewall for a PI Server and clients to
communicate? on the OSIsoft Technical Support Web site (http://techsupport.osisoft.com).
Troubleshooting
Procedures to troubleshoot conditions that prevent PI Web Services from executing correctly
are described here. To verify that PI Web Services software is installed correctly, see the
procedures listed in After Installation (page 28).
If you use the default installation of PI Web Services, you will find errors in the Windows
Application Log on the server hosting the Web service.
PI Web Services 2010 R3 offers further Error and Trace Message Logging (page 9) options
to debug Web service deployments. You can also record errors on the PI Server in a PI
message log, or log trace messages in normal operation. For configuration details, see
Logging and Instrumentation (page 119).
To identify and fix common error messages that can occur when calling PI Web Services,
select the Help topic that most closely describes the error.
Note: This message indicates that the PI SDK feature to automatically add servers to the
KST is disabled. To avoid this error in the future, you can enable this feature, as
described in the PI SDK Utility Help.
72
Data Entry Disallowed
Insufficient Permissions
Users of PI Web Services must have write access to the PI points into which they attempt to
insert data. If the user has no write access to the PI point included in the path of the
InsertPIData call, PI data insertions will fail.
Failed events are flagged in the TimedValue's (page 94) Status property. To determine which
insertions failed, examine the time and the path associated with TimedValue (page 94) Status
property of:
1000: Insufficient permission to access or complete operation.
[-10401] No Write Access - Secure Object.
74
Server Error in PI Web Services Application
Note: This error also appears when programming languages that use the backslash
character (\) to represent special characters are used, as with C#. To correct this,
use two backslashes to represent one backslash. For example, use
pi:\\\\piserver1\\sinusoid to represent the path
pi:\\piserver1\sinusoid.
76
Chapter 5
IPITimeSeries Interface
The IPITimeSeries interface contains methods that retrieve PI System data as collections of
TimeSeries (page 92) objects. TimeSeries (page 92) data consists of time stamped data values
as stored in a PI Server. TimeSeries (page 92) data are identified by paths (page 7) to PI
points, performance equations or PI AF attributes.
GetPIArchiveData Method
GetPIArchiveData retrieves data from the PI Server as Compressed, Interpolated and Plot
Values, and returns the data as an array of TimeSeries (page 92) objects. This method also
makes it possible to sign up for data updates.
GetPIArchiveData will generate one update ticket for every path for which updates are
requested. To sign up group of paths at one time and receive a single update ticket for the
group, see SignUpForPIUpdates (page 83).
Syntax
TimeSeries (page 92)[] GetPIArchiveData(PIArcDataRequest (page
87)[] requests)
Arguments
Array of PIArcDataRequest (page 87) objects
Returns
Array of TimeSeries (page 92)
The returned TimeSeries (page 92) array has the same number of elements as the input
PIArcDataRequest (page 87) array.
Errors
A data request that includes a sign-up for data updates, but cannot honor the sign-up, will fail
and report an error condition even if the request itself can be satisfied.
PI Web Services reports these error codes for updates:
Condition Error Property Value ErrDesc Property Value
Updates=true for af 4000 Updates are not supported for this type of
or pe path path: [path].
Updates=true and 4001 The end time of the request is not relative
end time is not relative and updates cannot be performed.
Updates=true, af 1005 Updates are not supported for PI AF data
path, af DR has an references with extended properties.
extended definition
Remarks
Note: In addition to the error codes listed above, error values returned may range from
1000 to 30xx; negative values indicate a PI SDK error.
The behavior during retrieval of Compressed values depends on whether the PI Server
contains events for the specified time range. If the time range specified in the request contains
no events, the TimeSeries (page 92) object returns an empty TimedValue (page 94) array. If
query paths (page 7) contain stale data, PI Web Services retrieves data only if the time range
includes the time of the most recent snapshot. To prevent retrieval of empty arrays, set the
Boundaries property of the PIArcManner (page 87) object of the PIArcDataRequest (page
87) to Outside.
This is important for queries of snapshot values that specify a TimeRange (page 91) for the
current time; these queries must specify StartTime=* and EndTime=* since the snapshot
value is usually before or at current time.
Calls to this method can also implicitly sign up one or more PI point or PI AF paths to receive
data updates, if the Updates property of the PIArcManner (page 87) object is set to TRUE.
78
PI Web Services Interfaces
When the registration succeeds, the SeriesID property of the returned TimeSeries (page 92)
object for that path is a string representation of the ticket that can be used with GetPIUpdates
(page 84), ListPathsByUpdateTicket (page 86) and CancelPIUpdates (page 84). Each path
registered will receive its own unique ticket in the SeriesID of the TimeSeries (page 92)
object returned.
Client applications can sign up for updates from multiple paths in a group operation if you
register the paths using SignUpForPIUpdates (page 83).
GetPISummaryData Method
GetPISummaryData returns summaries of PI archive data. This method can return averages,
means, minima, maxima, ranges, totals, values, counts, and both sample and population
standard deviations.
Calls to this method may also implicitly register one or more PI point paths to receive data
updates if the Updates property of the PISummaryManner (page 89) object is TRUE.
GetPISummaryData will generate one update ticket for every path for which updates are
requested. To sign up group of paths at one time and receive a single update ticket for the
group, see SignUpForPIUpdates (page 83).
Syntax
TimeSeries (page 92)[] GetPISummaryData(PISummaryDataRequest (page
89)[] requests);
Arguments
Array of PISummaryDataRequest (page 89) objects
Returns
Array of TimeSeries (page 92) objects
Errors
Calls to the GetPISummaryData method will report an error if:
• The Web service endpoint cannot be reached and no data are returned.
• A data request that involves a sign-up for data updates cannot honor the sign-up. Such a
call will fail even if the data request can be satisfied.
Data retrievals that fail for a PISummaryDataRequest (page 89) object, can result in various
errors. These error codes originate with PI Web Services:
Condition Error Value ErrDesc Value
Updates=true for pe path 4000 Updates are not supported for this type of path:
[path].
Updates=true and end time is 4001 The end time of the request is not relative and
not relative updates cannot be performed.
Updates=true, af path, af DR has 1005 Updates are not supported for PI AF data
an extended definition references with extended properties.
Remarks
Each path for which Updates is TRUE is signed up for updates separately and receives its
own unique update ticket in the SeriesID property of the returned TimeSeries (page 92)
object.
When the registration succeeds, the SeriesID property of the returned TimeSeries (page 92)
object for that path is a string representation of an update ticket that may be used with
GetPIUpdates (page 84), ListPathsByUpdateTicket (page 86) and CancelPIUpdates (page
84). When updates are later retrieved using the update ticket, the updates represent new or
changed values to the recorded values. They do not represent changes to the summary.
GetPISnapshotData Method
GetPISnapShotData returns the current snapshot for each path (page 7) passed to this method.
Syntax
TimeSeries [] GetPISnapshotData(string[] paths)
Errors
If an error occurs when data is retrieved for an individual path, PI Web Services reports the
error code in the Error property of the returned TimeSeries (page 92) object and describes the
error in the ErrDesc property.
Remarks
The returned TimeSeries (page 92) array has the same number of elements as the input string
array.
This method is equivalent to GetPIArchiveData (page 77) with a PIArcMannerRetrivalType
(page 88) of Compressed and PIArcMannerBoundaries (page 88) of Outside for the
TimeRange (page 91) that denotes current time; these queries must specify StartTime=* and
EndTime=* since the snapshot value is usually before or at current time.
Each successfully returned TimeSeries (page 92) array contains a TimedValue (page 94)
collection with a single TimedValue (page 94) object that represents the snapshot value.
InsertPIData Method
InsertPIData allows a client to insert values into one or more PI Server by passing an array of
TimeSeries (page 92) objects, each of which contains an array of TimedValues (page 94).
Syntax
TimeSeries[] InsertPIData(TimeSeries (page 92)[] events,
PIInsertDuplicateHandling duplicateSwitch )
80
PI Web Services Interfaces
Arguments
Events: an array of TimeSeries (page 92) objects that contain the data to be inserted into the
PI Server.
duplicateSwitch: an enumerated type that controls how duplicate values are processed:
Enumeration Value Usage
InsertDuplicate Always insert a new value. This
can result in the creation of
duplicate values, that is, multiple
values with the same time stamp.
ReplaceDuplicate Always insert the value, and
replace an existing event in the
archive that has an identical time
stamp as the submitted value. If
multiple duplicate events exist in
the archive, the first duplicate
encountered is updated with the
submitted value.
ReplaceOnlyDuplicate Insert the timed value only if it
replaces an existing value with the
same time stamp. If there is no
value at the passed time stamp,
the insertion does not occur and an
error is returned.
ErrorDuplicate Insert a timed value if there is no
existing value at the passed time
stamp. Return an error if there is
already a value in the PI Server
with the same time stamp.
ErrorDuplicatesSilent Write an error to the PI Server log
when an event with the same time
stamp exists but does not return an
error.
ReplaceOnlyDuplicatesSilent Write an error to the PI Server log
when there is no pre-existing event
with the given time stamp but no
error is returned to the client.
TimedValue (page 94) has two properties that control what is put into the PI Server: Status
and Value.
In most cases, the value of the Value property should be set to the data value that will be
inserted. This is true for all PI Server point types including digital state points.
Status must be null or blank or 0 if you intend to insert good data. Do not pass strings such
good as a Status for good data.
To use the TimedValue's Status property setting, it is important to note that:
• If the Status property is set with a negative number, it is passed as is. However, the
absolute value of the property is interpreted as the number of a system digital state and
the string value of that digital state is inserted in place of the value passed. For example,
if Status is set to -254, the system digital value Shutdown is inserted.
• If Status is a string that contains the text of a system digital state but the PI point is not a
string tag, the PI Server will reflect a system digital state. For example, if Status is set to
Shutdown and the PI point data type is Float16, the Value of the PI point is the digital
state Shutdown.
• If Status is a string and the PI point is a string, the PI Server is unable to determine
whether you are inserting a string or a digital state. In such cases, it is recommended that
the Status property be set to a negative number.
TimedValue (page 94) within each TimeSeries (page 92) must contain either the Value or
Status to be inserted into the PI Server. The value's time stamp comes from the TimedValue's
(page 94) Time member. The target path comes from the TimeSeries (page 92) object's path
member. If the TimedValue's (page 94) path member is populated, its path will override the
TimeSeries (page 92) object's path for that TimedValue (page 94) only.
Returns
If all data values are successfully inserted into the PI Server, this Web method returns a
TimeSeries (page 92) object with no TimedValues. The value of the SeriesID property of the
first TimeSeries (page 92) passed into the method is copied to the SeriesID property of the
TimeSeries (page 92) returned to the client. Client applications can use this to keep track of
asynchronous calls to InsertPIData.
If any TimedValue (page 94) objects are returned, they represent the objects that could not be
inserted due to errors. The value and time stamp of the failed value will be found in the
members of TimedValue (page 94). The TimedValue (page 94) object's properties will contain
the values the caller tried to insert, with the exception of the Status property, which records
the error message.
Errors
• If the client cannot reach the Web service end point, the method returns a fault and no
data are returned.
• If duplicateSwitch is ReplaceOnlyDuplicate and no value exists in the PI Server at the
submitted time stamp, the Status property of the returned TimedValue (page 94) is:
-2147219630: No value exists at specified timestamp.
• If duplicateSwitch is ErrorDuplicate and a value exists in the PI Server with the
submitted time stamp, the Status property is:
-2147219631: Value already exists at specified timestamp.
• If the Status property is set to a negative integer whose absolute value does not
correspond to a system digital state string, this error is set in the Status of the
TimedValue (page 94) object returned when the insertion is rejected:
-2147220396: Digital State not found. value
• If a string is passed in Status that does not correspond to a system digital state value and
the path refers to a non-string type tag, this error is returned:
-2147219633: Server returned write error: : [-15013] PIvalue
Type or PIstring is Not tag_datatype
82
PI Web Services Interfaces
Remarks
The path must be a PI path (pi:\\). You cannot reference a performance equation
(pe:\\) path, or a PI AF path (af:\\) when inserting data into the PI Server.
The calling user must have the necessary privileges to write events to the PI Server. The
web.config file for the Web service must also have its AllowDataEntry key set to the
default value TRUE.
Since the Time property of TimedValue (page 94) has a DateTime data type, the client must
generate an absolute UTC time stamp for data to be inserted into the PI Server. PI absolute
and relative time strings, including current time as *, cannot be used.
When failed events appear, the time stamps of these failed events are in the ISO 8601 UTC
format. That is, they will end in Z regardless of how they were passed in.
When failed events are returned, the Status property of the TimedValue object (page 94)
contains an error message; this is the only instance in which the TimedValue's (page 94)
Status property returned by PI Web Services does not contain a digital state.
When writing to a PI point of time stamp type, the Value property of the TimedValue object
(page 94) should be an ISO 8601 UTC date time string. If local PI time strings are passed,
they are converted to UTC time stamps on the Web server. When writing to such PI points,
the DataType property should be set to DateTime. This DataType value may be set for
either the TimeSeries (page 92) object or the individual TimedValue (page 94) objects.
Note: When used with InsertPIData, the UOM for the data to be inserted must be in units
that match the PI point; no UOM conversions are performed. For example, if a PI
point uses gallons per minute, the UOM for the inserted data must also use
gallons per minute.
SignUpForPIUpdates Method
SignUpForPIUpdates signs up for data updates for one or more paths without retrieving an
initial set of data. An update ticket is used to represent that entity.
Syntax
SignUpResults (page 95) SignUpForPIUpdates (string[] paths, ushort
expiration)
Arguments
paths: An array of strings that denotes the paths to the items for which data updates are
desired.
expiration: Duration, in minutes, of the sign-up before it expires and is removed from the list
of sign-ups. If expiration is 0, the expiration value is taken from the value of the
UpdatePurgeInterval property in the Web service's web.config file. If that setting does not
appear, expiration is set to five minutes. Any use of a given ticket in GetPIUpdates (page 84)
or ListPathsByUpdateTicket (page 86) resets the expiration timer.
Returns
SignUpResult (page 95) object. If the sign-up was successful, the ErrorCount property of the
object is 0 and the updateTicket property of that object is a valid GUID that can be passed
without change into the GetPIUpdates (page 84) method. If all paths in the specified array
fail sign-up, the updateTicket value is 00000000-0000-0000-0000-000000000000.
Errors
If at least one path can be registered for updates but one or more paths fail, a valid update
ticket is returned, but PI Web Services returns an Error of 4000 and the description:
Updates are not supported for this type of path: [path]. PI Data
Services (page 6) may also report errors that range from 1000 to 3099, PI SDK reports errors
with a negative Status value, such as point not found.
CancelPIUpdates Method
CancelPIUpdates will cancel sign-ups for paths associated to an update ticket, and therefore
free resources. After this method is called, the update ticket passed is no longer valid when
used in GetPIUpdates (page 84).
Syntax
void CancelPIUpdates (GUID updateticket)
Arguments
updateticket: A unique identifier to denote the collection of paths that is currently signed up
for updates to cancel.
Remarks
If an update ticket is found in the list of update sign-ups, the sign-up is removed. If an update
ticket is not found in the list of sign-ups, no error is returned. When an update ticket is
cancelled, updates are no longer available for any of the paths in the collection referenced by
the update ticket and the update ticket is invalid.
If a given path is signed up for updates through another update ticket, that update ticket can
still be used to get updates for the path.
GetPIUpdates Method
Client applications call the GetPIUpdates method to retrieve data updates for paths that were
previously signed up to receive data updates through GetPIArchiveData (page 77),
GetPISummaryData (page 80), or SignUpForPIUpdates (page 83).
Syntax
TimeSeriesUpdates[] GetPIUpdates(Guid updateTicket, ushort
maxWaitForUpdates, UpdateFilterType evtFilter)
84
PI Web Services Interfaces
Arguments
updateTicket: GUID returned when the path was signed up to receive updates
maxWaitForUpdates: Maximum number of seconds to wait during a call for updates. If this
value is greater than zero, the call will block until updates are available or this number of
seconds elapses without updates. If the number is zero, the call makes one attempt to retrieve
updates and returns.
evtFilter: Enumerated value that indicates whether to return snapshots (Snapsnot), archive
events (Archive), or both snapshot and archive event updates (SnapshotAndArchive).
Returns
An array of TimeSeriesUpdates (page 94) objects, is returned for each path associated with
the specified update ticket. If no data updates occurred for a registered path since the last call
for updates, a TimeSeriesUpdates object with no TimedUpdate objects is returned and the
Error property of the TimeSeriesUpdates object has the value 0. The SeriesID property of all
TimeSeriesUpdates objects is the same as the updateTicket.
Note: The TimedSeriesUpdate object has a TimedValues member which is always null.
The collection of updates is called Updates.
All data updates indicate the type of action that caused the update in the enumerated
UpdateType property of the returned TimedUpdate (page 95):
Action UpdateType Value
New snapshot value Snapshot
New archive event Archive
Deletion of existing event Delete
Change to existing event Edit
User inserts event into the PI Server with a time stamp AddNoReplace
that matches the time stamp of an existing event
Errors
If the update ticket does not reference an existing sign-up, an Error 4002 and an ErrDesc
value The update ticket was not found in the list of tickets
registered for updates is returned in an otherwise empty TimeSeries (page 92).
Remarks
When maxWaitForUpdates is greater than 0, the Web method checks if events occur in any
of the paths associated with the update ticket. If no events occur for any of the paths, the Web
service waits until any updates are available or the specified number of seconds has elapsed.
When maxWaitForUpdates equals 0, PI Web Services returns all available updates and does
not wait.
Use maxWaitForUpdates when the frequency of events for a given PI point is close to the
interval at which the application makes calls to the GetPIUpdates method. For such a case,
this parameter provides a grace period to avoid another call.
Sign-ups for data updates expire after the interval is set by the UpdatePurgeInterval property
in the web.config file. This feature prevents clients from failing or terminating before a sign-
up is cancelled. The Web service will return a TimeSeries object with the Error 4002 if a
sign-up has expired, was cancelled by a CancelPIUpdates (page 84) call, or used an incorrect
update ticket.
ListPathsByUpdateTicket Method
ListPathsByUpdateTicket retrieves the paths (page 7) associated with a specified update
ticket so that a user can see which PI paths were signed up for data updates for the given
update ticket.
Syntax
string[] ListPathsByUpdateTicket (GUID updateTicket)
Errors
If the update ticket is not found in the list of updates, a SOAP fault is thrown with the
message: The update ticket was not found in the list of tickets
registered for updates.
Remarks
All paths are returned in the format in which they were originally submitted. The update
ticket provided must reference an active (that is, unexpired) sign-up for data updates.
GetProductVersion Method
GetProductVersion reports the version of the assembly that implements the interface as
viewed in Windows Explorer.
Syntax
string GetProductVersion()
Returns
A string representing the version of the PIWebServices.dll assembly. For example:
1.2.7.0.
Errors
None
Remarks
The version is determined when the assembly is loaded and stored for subsequent use. For
example, PI Web Services 2010 R3 will return a string value of 1.2.8.0.
86
PI Web Services Interfaces
PIArcDataRequest
Applies to (page 77)
Represents a query to a PI System for Compressed, Interpolated or Plot Values from a single
path (page 7), subject to a single time range (page 91) constraint (page 9) that uses a single
Manner (page 9). Since an array of PIArcDataRequest objects can be passed in a single call
to GetPIArchiveData (page 77), any number of independent data requests can be placed at
once.
Members
Path (page 7)
PIArcManner (page 87)
TimeRange (page 91)
PIARCMANNER
Member of (page 87) Applies to (page 77) Members (page 87)
This class contains properties needed to define retrieval behavior for Archive data. Use it to
specify Compressed, Interpolated or Plot Values retrieval, boundary handling, and data limits.
Example
PIArcManner myPIArcManner = new PIArcManner();
myPIArcManner.RetrievalType= PIArcMannerRetrievalType.Compressed;
myPIArcManner.Boundaries= PIArcMannerBoundaries.Outside;
myPIArcManner.NumValues = 100;
Members
NumValues
Member of (page 87) Applies to (page 77)
Use the NumValues property to specify how values are retrieved from the PI Server:
• For Compressed values, NumValues sets the maximum number of values to return.
• For interpolated values, NumValues sets the number of interpolation intervals into which
the time range is evenly divided.
• For Plot Values, NumValues sets the number of screen pixels in the representation of a
trend.
• When retrieving Plot Values, no truncation is performed and the number of timed values
returned can be up to five times the value of NumValues.
Minimum value is 1. Default: 400.
PIArcMannerBoundaries
Member of (page 87) Applies to (page 77)
Parameter that defines how Compressed events are retrieved, relative to the time range
boundaries. You can specify the boundaries as:
• Inside (default) – Return only events that fall within the time range or precisely at the
boundaries
• Outside – Return events within the time range plus the first value that precedes the time
range and the first value that follows the time range
• Interpolated – Return events within the time range plus interpolated values at the start
and end of the time range
Example
arcmnr.Boundaries = PIArcMannerBoundaries.Outside;
PIArcMannerRetrievalType
Member of (page 87) Applies to (page 77)
An enumeration that defines the type of Archive data retrieved.
Enumeration values:
• Compressed (default) – Actual values recorded in the PI Server
• Interpolated – Generates interpolated values at intervals equal to the time range duration
divided by the NumValues property
• Plot Values – Generates an array of values suitable for trending. This retrieval type takes
into account the number of pixels on a display and generates the most significant values
for each.
Example
arcmnr.RetrievalType = PIArcMannerRetrievalType.Compressed
Updates
Member of (page 87) Applies to (page 89)
Use the Updates property to designate a path to sign up for data updates:
• Set to TRUE to enable data updates.
• Default is FALSE.
Data updates are supported for pi paths and af paths that specify a simple PI AF data
reference.
Filter
88
PI Web Services Interfaces
A string expression in performance equation (PE) syntax used to filter values returned for PI
points in Compressed mode, for example 'sinusoid' > 25.
Note: Filters are only supported for PI point retrieval in Compressed or Interpolated
mode, or PI AF data references in Compressed mode. The PI point name in the
filter expression must the point's tag name. Do not use the name of the PI AF data
reference attribute.
PISummaryDataRequest
Applies to (page 79)
Represents a query for summary data from a single path (page 7) for a given time range
subject to certain parameters. Since an array of PISummaryDataRequest objects can be
passed in a single call to GetPISummaryData (page 79), any number of independent
summary data requests can be placed at once.
Members
Path (page 7)
TimeRange (page 91)
PISummaryManner (page 89)
PISUMMARYMANNER
Member of (page 89) Applies to (page 79) Members (page 89)
Represents the type of summary retrieval. Use this object to specify the summary type and
other properties.
Members
Intervals
Member of (page 89) Applies to (page 79)
Represents the number of evenly spaced intervals into which the time range of the query
should be divided. The duration of the time range, divided by this value, forms the length of
the interval for which the summary calculation is performed.
Set the start time or end time of the interval, with UseStart, a Boolean property. If True, the
time of the start of the time interval over which the summary is calculated is reported as the
time for the resulting TimedValue (page 94). If False, the end time of the interval is reported.
Example
mySummaryManner.Intervals = 4;
PISummaryMannerSummaryValue
Member of (page 89) Applies to (page 79)
An enumeration specifying the type of summary calculations:
• Average (default)
• Count
• Minimum
• Maximum
• PStdDev (Population Standard Deviation)
• Range
• StdDev
• Total
Example
mySummaryManner.SummaryManner =
PISummaryMannerSummaryValue.Maximum;
PISummaryMannerWeightType
Member of (page 89) Applies to (page 79)
Use this enumeration to set the calculation basis for summary calculations:
• TimeWeighted - (default) Weight the values in the calculation by the time over which
they apply
• EventWeighted - Evaluate values with equal weighting for each event
UseStart
Boolean value that indicates whether the Start time of each interval is reported as the time
stamp for the interval’s summary value.
If TRUE, the time of the start of the time interval over which the summary is calculated is
reported as the time for the resulting TimedValue (page 94). If FALSE, the end time of the
interval is reported.
When updates are later retrieved using the update ticket, the updates represent new or
changed values to the recorded values. They do not represent changes to the summary.
Updates
Boolean value to enable updates, if set to TRUE. Updates for pi paths and some af paths that
specify a PI AF data reference. Paths that specify extended PI AF data references are not
supported.
By default Updates is disabled, or FALSE.
90
PI Web Services Interfaces
Filter
Not supported.
TimeRange
Represents the start and end times of a time range.
This class models the traditional PI time range construct. The start and end times can be
represented as either PI relative times (page 11), or as PI or ISO 8601 absolute times (page
12).
Applies to
GetPIArchiveData (page 77)
GetPISummaryData (page 79)
Members
StartTime and EndTime (page 91)
selects a time zone with the same offset, which might not match that of the time zone where
the user is located. Furthermore, PI Web Services cannot fix times passed because it does not
know which time zone rules to apply, and the user cannot specify two offsets in a single
query.
OSIsoft recommends that times be supplied to PI Web Services in UTC. Queries that use
UTC yield correct results even if queries are submitted during the hour in which DST
changes to, or from, standard time.
TimeSeries
Properties (page 92)
This class represents a time series of timed values. It consists of a set of properties (page 92)
that pertain to the time series and an array of TimedValue (page 94) objects that contain the
actual time stamped data.
Applies to
GetPIArchiveData (page 77)
GetPISummaryData (page 79)
PROPERTIES
Properties of the TimeSeries class:
Name Data Type Description
Path String Name of a PI System data source such as a PI point or a PI
AF element attribute. Every element of the TimedValue
(page 94) array normally comes from this path. TimedValue
(page 94) does have its own Path member which is
normally blank but can be used to override this path. This
can be done by client software when calling InsertPIData
where it is possible to send data values to many PI paths in
a single TimedValue array.
UOM String Unit of measure of all TimedValue objects. The TimedValue
(page 94) class also has a UOM field which can be used to
override this value.
Note: When used with InsertPIData (page 80), the UOM for
the data to be inserted must match the UOM of the data into
which the insert takes place. For example, if a PI point uses
gallons per minute, the UOM for the inserted data must also
use gallons per minute.
92
PI Web Services Interfaces
These properties reflect the data type that best matches the underlying PI System data type.
The data received by the PI Web Services hides the difference between different sizes of
types. For example, single and double precision floating point types are presented to the Web
service as double precision.
Note: When using InsertPIData (page 80), you do not need to include the data type.
This table summarizes the mapping between common data types and the value of the
DataType property, as performed by the Web service:
Common Type Value of DataType Property
Boolean Boolean
Decimal Decimal
single, double precision floating point Double
int16, int32 Int
time, date time DateTime
BLOB Byte[]
PI Digital, string String
Note: BLOB data is not currently available through PI Web Services. BLOB data is
represented as a data type of byte. The Value property of a TimedValue (page 94)
object whose DataType value is Byte will be null.
Digital tag data values are reported using the string representation of the digital state, not the
numeric code.
TIMEDVALUE
Applies to (page 92) Properties (page 94)
This class represents a single time-stamped data value retrieved from or sent to the PI
System. The TimeSeries (page 92) class contains an array of TimedValues.
PROPERTIES
Properties of the TimeValued (page 94) class:
Name Data Type Description
Path String (Optional) Name of a PI System data source. When a TimeSeries
object is returned from a Web method call, Path is reflected in the
TimeSeries class for every element of the TimedValue array; This
field is used primarily in InsertPIData; where it is possible to send
data values to many paths in a single TimedValue array
Time XSD dateTime, Time stamp of the value in UTC
.NET DateTime
UOM String (Optional) Unit of measure of the value; This is usually blank
because the UOM is usually the same for the entire TimeSeries and
is specified there; If this field is not blank, the UOM overrides this
value only
Flags String (Optional) Denotes whether the value is Questionable (Q),
Substituted (S), or Annotated (A) in the PI Server; Possible values
are any combination of Q, S, and A
Status String (Optional) If a value is non-zero, this property contains a Status
string indicating what is wrong with the value. Note: When entering
data through InsertPIData, Status should be populated with the
digital state value being inserted. If Status is populated, the value is
ignored.
PctGood Double (Optional) This property is only used when summary values are
retrieved through GetPISummaryData. In that operation, the percent
of data in the calculation interval with good values is reported if it is
less than 100 percent; intervals with 100 percent good data do not
report this value; that way, response message size remains
minimal.
DataType String (Optional) XSD standard name of the value’s data type; This is
usually blank because the data type is usually the same for the
entire TimeSeries and is specified there; If this field is not blank, the
data type overrides this value only
Value String Data value
TimeSeriesUpdates
Applies to (page 84)
This object is derived from TimeSeries (page 92). In addition to the properties of that object,
TimeSeriesUpdates adds the property Updates, which is an array of TimedValueUpdate (page
95) objects.
94
PI Web Services Interfaces
TimedValueUpdate
This object is derived from TimedValue (page 94). In addition to the properties of that object,
TimedValueUpdate adds an enumerated property UpdateType. The enumeration, also named
UpdateType, permits the values Archive, Snapshot, Delete, Edit, and AddNoReplace.
Instances of this object are returned by GetPIUpdates (page 84).
When you call GetPIUpdates, the TimedValues property is null and TimeSeriesUpdates (page
94) is an instantiated object. TimedValue (page 94) is used for the regular data methods such
as GetPIArchiveData (page 77); TimeSeriesUpdates (page 94) is only used for GetPIUpdates
(page 84).
SignUpResult
Applies to (page 83)
Class used to communicate the results of explicit registration for data updates through the
SignUpForPIUpdates (page 83) method.
Properties
UpdateTicket: GUID. Paths which are successfully signed up for updates return the value of
path as a valid GUID. If all sign-ups fail, the path value is an empty GUID: 00000000-
0000-0000-0000-000000000000.
Errors: int[]. Array of error codes. When a sign-up is successful, the corresponding value
is 0.
ErrDescs: string[]. When a sign-up is successful, the corresponding value is an empty
string. When the error entry is non-zero, the value in ErrDescs describes the error.
ErrorCount: Integer count of the number of errors. That is, the number of entries in Errors
with a non-zero value. If ErrorCount is greater than 0, the client should iterate through the
array and determine which path(s) failed sign-up.
Remarks
Errors, and ErrDescs will always have the same number of entries. This number will match
the number of paths passed into SignUpForPIUpdates (page 83), and the order of entries will
match. For any entry i, Errors[i], and ErrDescs[i] will completely record the
results of the sign-up for paths[i]. If ErrorCount is 0, clients may pass the updateTicket
into GetPIUpdates (page 84) to retrieve data updates.
If ErrorCount is greater than zero, the client should iterate through the array and determine
which path(s) failed sign-up. Empty GUID values for updateTicket 00000000-0000-
0000-0000-000000000000 result from unsuccessful sign-ups for all paths.
IPISearch Interface
The IPISearch interface contains methods that search PI Systems and return collections of
paths (page 7). Returned paths can be used by methods of the IPITimeSeries interface (page
77) exactly as they are retrieved.
FindPIPathsBasic
This method performs a simple tag search, similar to that used in the Basic Search tab of the
PI SDK Tag Search and the PI SDK IGetPoints2.GetPoints method. It returns the tags for
PI points that meet the specified criteria. Returns consist of an array of paths (page 7), in a
syntax suitable for use with methods from the IPITimeSeries interface.
Syntax
string[] FindPIPathsBasic(string server, string tagMask, string
pointtype, string pointsource, string classname, string
descriptor, string UOM, int numValues)
The search returns an array of paths suitable for use with the IPITimeSeries interface (page
77).
Arguments
server: String that denotes the full name of the PI Server to search without leading slashes.
This search is not valid for PI Asset Framework (AF) servers. Wildcard characters are not
permitted.
tagMask: String that contains the PI tag mask, including the optional wildcard characters *
and ?.
pointtype: String that consists of one of the supported PI Web Services, PI tag types, or the
wildcard character *.
PI Types:
Float16 Digital Timestamp
Float32 Int16 BLOB
Float64 Int32 String
96
PI Web Services Interfaces
DateTime Timestamp
Byte[] Blob
pointsource: Point source, including optional wildcards. For example, a PI point named
FIC*.PV
classname: Point class, including optional wildcards. Examples include Base and Classic.
descriptor: PI point description, including optional wildcards.
UOM: Units of measure, that is, PI point engineering units, including optional wildcards.
numValues: Maximum number of paths to return. Default is 100. If the number of paths
matching the search criteria exceeds numValues, the Web service returns the first numValues
paths returned from the PI Server.
Returns
A string array that contain the tags for PI points that meet the specified criteria, in a format
that is suitable for use as paths (page 7) in methods of the IPITimeSeries (page 77) interface.
For example, the tag for a PI point named sinusoid on a PI Server named piserver01, is
returned as pi:\\piserver01\sinusoid.
Remarks
If tagMask, pointtype, pointsource, classname, descriptor or UOM are passed as empty or
null strings, it means that no particular value of these parameters is required. It is as if a
wildcard character * is passed.
The pointtype parameter is examined without regard to case.
This method does not include search by Value or Status.
The paths returned are suitable for use with any of the methods in IPITimeSeries (page 77).
However, the retrieval of BLOB type data for PI tags is not supported.
PIPointType
Enumeration denoting a PI point type:
• Float16
• Float32
• Float64
• Int16
• Int32
• Digital
• String
• Timestamp
• Any - represents wildcard *
98
Chapter 6
The form created here retrieves time series data with the GetPIArchiveData method:
Note: Alternatively, use the Design a Form Template option from the Getting
Started dialog.
3. Select Web Service from the Based On options in Design a Form Template and click
OK.
4. Click Next to accept the default option in the Data Connection Wizard – Receive and
submit data.
5. Enter the path to PI Web Services that you will use for data connection:
6. Select the method (page 101) that the form will use.
100
Select a Method
Select a Method
InfoPath queries PI Web Services for metadata in a process that might take several seconds.
When the process is complete, the Data Connection Wizard gives you the option to select a
method supported by the PI Web Services 2010 R3:
ο InsertPIData
ο GetPISummaryData
ο GetPIArchiveData
1. Select GetPIArchiveData and click Next.
2. Accept the default name of Main query or provide another name to identify the data
connection that will receive data entered into the form and click Next.
3. Configure the input (page 101) that the fields will use.
2. Select Field or Group in Parameter options and click the button to the right of the
field.
3. Select the requests element in Select a Field or Group:
4. Click OK.
5. Click Next.
6. Click Finish.
7. Design the layout (page 102) for the form template.
102
Design Returned Data Display
To lay out fields on the form that will elicit the request parameter values and display the
response values:
1. Drag the Path element onto the form to create a text field within a repeating section.
2. Drag the TimeRange element onto the repeating section under Path.
Note: You can change the width of the text fields. However, do not change the
control type from text fields. Date picker controls (page 107) cannot be used
to submit PI relative times.
3. Drag PIArcManner onto the form. Place it within the repeating section created by
dropping Path onto the form, but outside the section that encloses TimeRange. Select
repeating section with controls.
4. Next, design the layout of the display (page 103) for the data returned from PI Web
Services:
4. Next, create form fields for the individual timed values returned. If you examine the
TimedValues field in the tree on the right of the form, you will note that there is nothing
listed for value. This occurs because the value itself is returned as the textual content of
an XML element in the Web service reply. In order to pick this up, drag the entire
TimedValue (page 94) object onto the repeating section created above, then edit the table
based on what the Web service actually returns for this method.
104
Design Returned Data Display
a. Select the TimedValue field and drag it into the TimeSeries repeating section,
placing it directly beneath the Datatype field:
b. Select repeating table from the options. Note that each row is crowded. You can edit
this to make it more presentable. Much of the data fields defined for the TimedValue
object overlaps the TimeSeries object, or are used in different Web service methods.
For example, since every TimedValue returned in this method will have the same
path as the parent TimeSeries, the Web service does not repeat this information. This
reduces the amount of data transmitted over the network for each call. The pctGood
property, moreover, is used when performing summary retrievals using the
GetPISummaryData method.
c. Select the column of the table that contains Path, then right-click and select Delete >
Columns:
d. Repeat Steps a through c for UOM, PctGood, and DataType. Adjust the size of the
fields as desired. The results should be similar to this:
106
Change the Date Picker Control
108
Test the Form
Note: The security configuration changes described in this appendix will affect all
applications running in the IIS Web application.
PI Web Services uses delegation to perform operations on behalf of the calling user. The
underlying PI Data Services data layer, also uses delegation. This results in a double hop
situation that requires proper configuration of PI Web Services.
PI Web Services ships with a web.config file that is properly configured for the double-
hop situation if the Web service is running on the IIS Web under the NETWORK SERVICE
account. When an application pool uses another identity, you must configure an SPN as
described here. To create an SPN, you must have domain administrator privileges.
If the IIS application pool runs under a domain account, you must complete these additional
steps to configure Kerberos delegation:
• Associate an SPN with the domain account
• Mark the domain account as trusted for delegation in Active Directory
• Modify web.config
Prerequisites
To use Kerberos delegation, the Web server that hosts the product must be configured to
accept the user’s login credentials and relay them to the remote server.
To achieve this configuration:
• All servers are Windows 2003 or Windows 2008
• All user accounts, service accounts and computers are members of the same Active
Directory forest
• The installing user is able to select the application pool under which the Web service will
run
If you are using PI Web Services on a server that is also running PI WebParts, you can find
procedures to enable Kerberos delegation on a SharePoint server in these Microsoft articles:
• For SharePoint Server 2010:
http://technet.microsoft.com/en-us/library/ee806870.aspx
• For SharePoint Foundation 2010:
http://technet.microsoft.com/en-us/library/ff607695.aspx
• For Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007:
http://support.microsoft.com/?id=832769
The Kerberos protocol relies on Service Principal Names (SPNs) that associate services with
domain accounts. If the Application Pool is configured to run under a domain account, an
SPN must be established to bind the domain account to the HTTP service.
Note: The application pool can be associated with a local machine account or a domain
account, depending on your site’s security policies.
SPNs are administered with the command line tool SETSPN available from the Microsoft
Web site or the Windows Operating System:
• SETSPN is available in Windows Server 2008 when the Active Directory Domain
Services role is added.
• SETSPN for Windows 2003 is part of support tools included with Windows Server 2003
Service Pack 1 (SP1); See: http://support.microsoft.com/kb/892777
Create an SPN
Use the SETSPN utility to create an HTTP SPN for a Web site. For example, for a Web
service that runs under the account piwp123\1ws that is accessed at
http://corporatews.piwp123.com/ws.asmx:
SETSPN -A HTTP/corporatews.piwp123.com piwp123\1ws
112
Configure the User Account
Note: To perform this step, you must have permission to modify the permissions of the
account in Active Directory.
In Active Directory Users and Computers, trust the domain account using delegation:
1. From the account properties dialog, click the Account tab.
2. Under Account Options, click to select the Account is trusted for delegation.
3. Click OK.
Open the web.config file and locate the servicePrincipalName binding element. Change
HOST/machine_name to the value of the SPN established in the first step. For the
example above, the value would be set to HTTP/piwsserver1.
Within IIS, Web sites can be configured to share a single IP address and a port number if they
are accessed through different host headers. For clients to access the Web site using a host
header, a DNS entry must be configured to resolve the IP address correctly. In such cases, the
fully-qualified domain name that is used to access the Web site is not same as the machine
name. To enable Kerberos delegation to work as expected, a new SPN must be established for
the HTTP service and the fully-qualified domain name.
For example, a Web server name CORPORATE1WEB has two Web sites:
Site Port Header App Pool Identity FQDN
Site1 80 sample Network Services sample.piwp123.com
Site2 80 example piwp123\1web example.piwp123.com
All supported SharePoint versions can be installed in a Web farm consisting of multiple
front-end Web servers sharing a single configuration database. The Web farm is accessed
through a single URL established in DNS that points to the Web farm cluster address. As
with host headers, a Kerberos SPN must be established for both the NETBIOS name and the
domain name of the farm.
For example, a Web farm at http://piwpfarm.piwp123.com is configured with
application pools running under a domain account piwp123\1web. To add the SPN:
SETSPN -A HTTP/PIWPFARM piwp123\1web
SETSPN -A HTTP/piwpfarm.piwp123.com 1web
Troubleshooting
Log out of the client machine and log back in with the appropriate user account, and then
browse to the page with double-hop data access. On the Web server, view the security event
log to see which protocol is being used for authentication. There will be events for the user
account that show Successful Network Logon and list the Authentication Package that was
used. If the package is NTLM instead of Kerberos, double-hop cannot succeed. This might
occur because the Web server is not configured to accept Kerberos or because the client
account cannot use Kerberos.
114
Use of Alternate port numbers
Look in the security event log on the target machine where the data source resides, either the
file server, the Web service machine or the database server. There will be events for the user
account that show Successful Network Logon and list the user name and the Authentication
Package that was used. If the package is NTLM and the user name is blank, the Web server is
not using Kerberos to communicate with the target machine. If the client is successfully using
Kerberos to connect to the Web server, this hop can fail because the target machine is not
configured to use Kerberos.
Resources
KerbTray is a useful utility that helps diagnose Kerberos issues for Windows Server 2003. It
displays Kerberos tickets and can purge the credentials without logging out and is available at
the Microsoft Web site.
A comprehensive discussion of Kerberos troubleshooting can be found in the Microsoft
article Troubleshooting Kerberos at http://technet.microsoft.com/en-
us/library/cc728430.aspx.
For example, a Web server name CORPORATE1WEB has two Web sites:
Site Port Header App Pool Identity FQDN
Site1 80 sample Network Services sample.piwp123.com
Site2 80 example piwp123\1web example.piwp123.com
Troubleshooting
Establishing Kerberos delegation in an existing distributed environment can be challenging,
especially if Service Principal Names must be established or if the domain policies have been
restricted. As with other networking tasks, the best approach is to confirm one hop at a time.
Log out of the client machine and log back in with the appropriate user account, and then
browse to the page with double-hop data access. On the Web server, view the security event
log to see which protocol is being used for authentication. There will be events for the user
account that show Successful Network Logon and list the Authentication Package that was
used. If the package is NTLM instead of Kerberos, double-hop cannot succeed. This might
occur because the Web server is not configured to accept Kerberos or because the client
account cannot use Kerberos.
Look in the security event log on the target machine where the data source resides, either the
file server, the Web service machine or the database server. There will be events for the user
account that show Successful Network Logon and list the user name and the Authentication
116
Troubleshooting
Package that was used. If the package is NTLM and the user name is blank, the Web server is
not using Kerberos to communicate with the target machine. If the client is successfully using
Kerberos to connect to the Web server, this hop can fail because the target machine is not
configured to use Kerberos.
Resources
KerbTray is a useful utility that helps diagnose Kerberos issues for Windows Server 2003. It
displays Kerberos tickets and can purge the credentials without logging out and is available at
the Microsoft Web site.
A comprehensive discussion of Kerberos troubleshooting can be found in the Microsoft
article Troubleshooting Kerberos at http://technet.microsoft.com/en-
us/library/cc728430.aspx.
<logFilter logMode="Warnings"
Change the logMode (page 124) from Warnings to All to enable trace messages.
Initial Settings
Parameters for log settings are preconfigured in the PIInstrumentation.config file,
which is located in the PIPC\DAT directory. This file is automatically created when you
install a product that includes the instrumentation framework.
To adjust logging and trace settings, modify PIInstrumentation.config. You do not
need to restart your application after you modify PIInstrumentation.config
The PIInstrumentation.config file contains separate sections where you can find
settings for the following:
• <EventSources> (page 120)
• <Listeners> (page 120)
• <LogFilters> (page 122)
• <Formatters> (page 122)
<EventSources>
Event sources are message sources predefined by each client using the PI Instrumentation
Framework.
The <EventSources> section in PIInstrumentation.config (page 119) includes
application-specific event sources listed by type. Associated filter bindings sections act as
channels to deliver messages to appropriate listeners. For example:
<EventSource
name="PIWebServices.PIDataService.PIWebServicesInstrumentation.PIW
ebServicesTraceSourceTypes.PIWebServicesSearch" descriptions="PI
Web Services Search source" client="PI Web Services">
<eventSourceParamList>
<EventSourceParameter name="FilterBindings"
value="defaultFilterBindings" />
<EventSourceParameter name="DebugInfo" value="false" />
</eventSourceParamList>
</EventSource>
<EventSource
name="PIWebServices.PIDataService.PIWebServicesInstrumentation.PIW
ebServicesTraceSourceTypes.PIWebServicesTimeSeries"
descriptions="PI Web Services time series source" client="PI Web
Services">
<eventSourceParamList>
<EventSourceParameter name="FilterBindings"
value="defaultFilterBindings" />
<EventSourceParameter name="DebugInfo" value="false" />
</eventSourceParamList>
</EventSource>
• FilterBindings—contains the name of the LogFilter (page 122) set to be used by this
client source for logging messages.
• DebugInfo—option that enables logging of more detailed information such as stack
traces and process identity information. By default it is set to FALSE. Change this value
to TRUE to enable it.
<listeners>
The PI Instrumentation Framework currently supports three listeners that enable you to view
logs and errors:
• Windows Event Log—recommended tool that comes with Microsoft Windows. By
default PI Instrumentation is set for this listener.
120
Initial Settings
• PI Message Log (in PI SMT)—for PI System admins who want to read logs while
working with PI System tools.
• DebugView for Windows—enables more detailed logging and debugging information.
This listener also enables you to save error messages in a text file that can then be sent to
the OSIsoft Technical Support team for additional troubleshooting. You must download
this application from the Microsoft Web site (http://technet.microsoft.com/en-
us/sysinternals/bb896647.aspx).
Note: By default only the Windows Event Log listener is configured to receive logging
and error information. You can add the other listeners by modifying the
PIInstrumentation.config file, however, keep in mind that additional
listeners may result in some performance loss on your server.
<listeners>
<listener xsi:type="WMIListener" name="WmiTraceListener"
descriptions="Windows Event Log"
type="OSIsoft.PIInstrumentation.Listener.WmiTraceListener"
listenerDataType="OSIsoft.PIInstrumentation.Listener.WmiTraceListe
ner, OSIsoft.PIInstrumentation.Listeners, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=53b77d1d3d7a979b"
formatter="General" machineName="." />
</listeners>
Note: Some listeners may have a few additional parameters. For example, the PI SDK
message listener configuration requires a PI Server named with the PIServer
parameter.
<LogFilters>
LogFilters are the main drivers of configuration for all message logging, and are frequently
referenced by event source configuration entries. The default LogFilter configuration enables
you to log all the warnings and errors from all client sources to the Windows Event log.
Most modifications to PIInstallation.config are completed in the <LogFilters>
section. See Modify Configuration (page 123) for more details.
<formatters>
This section contains all the formatters and their associated templates. Listeners format
messages according to a specified template before logging them. For example:
<formatters>
<formatter name="TextFormatter" descriptions="Text Formatter"
type="OSIsoft.PIInstrumentation.Listener.Formatter.TextFormatter,
OSIsoft.PIInstrumentation.Listeners, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=53b77d1d3d7a979b"
template="Message: {message}{newline}Category:
{category}{newline}Priority: {priority}Extended Properties:
{dictionary({key} - {value}{newline})}" />
<formatter name="XMLFormatter" descriptions="XML Formatter"
type="OSIsoft.PIInstrumentation.Listener.Formatter.XmlLogFormatter
, OSIsoft.PIInstrumentation.Listeners, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=53b77d1d3d7a979b" template="" />
</formatters>
Each formatter configuration has the following parameters:
• Name—referenced by listener configuration to select the correct formatter
• Descriptions—used to describe the formatter
• Type—used to instantiate the formatter object and format the message
• Template—references a key-value pair template collection used to specify a label for
the message and how it should appear when logged. For example:
Timestamp: {timestamp}{newline}
where {timestamp} is the value substituted from the LogEntry
object. The output format appears as
Timestamp: 8/24/2008 2:10:54 pm
followed by a new line.
Note: For the formatter name value XMLFormatter, the actual LogEntry object is an
XML document and requires no template specification.
122
Modify Configuration
Modify Configuration
Most manual changes to instrumentation settings are made in the <logFilters> (page 122)
section of the PIInstrumentation.config (page 119) file. Under <logFilters>, you
may adjust the following:
• Add/Remove Listeners (page 123)— provide destinations for messages to be sent
• Filter Messages (page 123)—configure what messages appear in your logs
Add/Remove Listeners
Filter Messages
LogMode Filter
The LogMode setting determines what kind of message should be logged. There are three
possible settings:
• Errors—logs only the error messages
• Warnings— logs error and warning messages
• All—logs all the messages, including informational messages
124
Message Throttling
Priority Filter
Each message object has a priority setting. If the priority meets the range between the
minimum and maximum priority filter levels, then the message is logged.
In the priorityFilter section you can set the following parameters:
• name
• type
• minimumPriority
• maximumPriority
Keyword Filter
This setting logs the message if the message has any specific keyword which you would like
to monitor.
In the keywordFilter section you can set the following parameters:
• name
• keyword
Message Throttling
The PI Instrumentation Framework includes a message throttling component that prevents
client applications from flooding logs with duplicate messages when there is a recurring
problem. The default value is 5 minutes, meaning that if the same message repeats within 5
minutes, logging applications will not log that message.
To modify this setting edit the web.config file located on your client machine. Edit the
following entry under <appSettings> to adjust throttling settings.
<add key="ErrorSuppressionTime" value="" />
You can contact OSIsoft Technical Support 24 hours a day. Use the numbers in the table
below to find the most appropriate number for your area. Dialing any of these numbers will
route your call into our global support queue to be answered by engineers stationed around
the world.
Office Location Access Number Local Language Options
San Leandro, CA, USA 1 510 297 5828 English
Philadelphia, PA, USA 1 215 606 0705 English
Johnson City, TN, USA 1 423 610 3800 English
Montreal, QC, Canada 1 514 493 0663 English, French
Sao Paulo, Brazil 55 11 3053 5040 English, Portuguese
Frankfurt, Germany 49 69 951 555 333 English, German
Manama, Bahrain 973 1758 4429 English, Arabic
Singapore 65 6391 1811 English, Mandarin
86 021 2327 8686 Mandarin
Perth, WA, Australia 61 8 9282 9220 English
Support may be provided in languages other than English in certain centers (listed above)
based on availability of attendants. If you select a local language option, we will make best
efforts to connect you with an available Technical Support Engineer (TSE) with that language
skill. If no local language TSE is available to assist you, you will be routed to the first
available attendant.
If all available TSEs are busy assisting other customers when you call, you will be prompted
to remain on the line to wait for the next available TSE or else leave a voicemail message. If
you choose to leave a message, you will not lose your place in the queue. Your voicemail will
be treated as a regular phone call and will be directed to the first TSE who becomes available.
If you are calling about an ongoing case, be sure to reference your case number when you call
so we can connect you to the engineer currently assigned to your case. If that engineer is not
available, another engineer will attempt to assist you.
Search Support
From the OSIsoft Technical Support Web site, click Search Support.
Quickly and easily search the OSIsoft Technical Support Web site's support solutions,
documentation, and support bulletins using the advanced MS SharePoint search engine.
techsupport@osisoft.com
When contacting OSIsoft Technical Support by e-mail, it is helpful to send the following
information:
• Description of issue: Short description of issue, symptoms, informational or error
messages, history of issue.
• Log files: See the product documentation for information on obtaining logs pertinent to
the situation.
From the OSIsoft Technical Support Web site, click My Support > My Calls.
Using OSIsoft's Online Technical Support, you can:
• Enter a new call directly into OSIsoft's database (monitored 24 hours a day)
• View or edit existing OSIsoft calls that you entered
• View any of the calls entered by your organization or site, if enabled
• See your licensed software and dates of your Service Reliance Program agreements
128
Message Throttling
Remote Access
From the OSIsoft Technical Support Web site, click Contact Us > Remote Support
Options.
OSIsoft Support Engineers may remotely access your server in order to provide hands-on
troubleshooting and assistance. See the Remote Support Options page for details on the
various methods you can use.
On-Site Service
From the OSIsoft Technical Support Web site, click Contact Us > On-site Field Service
Visit.
OSIsoft provides on-site service for a fee. Visit our On-site Field Service Visit page for more
information.
Knowledge Center
From the OSIsoft Technical Support Web site, click Knowledge Center.
The Knowledge Center provides a searchable library of documentation and technical data, as
well as a special collection of resources for system managers. For these options, click
Knowledge Center on the Technical Support Web site.
• The Search Support feature allows you to search Support Solutions, Bulletins, Support
Pages, Known Issues, Enhancements, and Documentation (including user manuals,
release notes, and white papers).
• System Manager Resources include tools and instructions that help you manage archive
sizing, backup scripts, daily health checks, daylight saving time configuration, PI Server
security, PI System sizing and configuration, PI trusts for interface nodes, and more.
Upgrades
From the OSIsoft Technical Support Web site, click Contact Us > Obtaining Upgrades.
You are eligible to download or order any available version of a product for which you have
an active Service Reliance Program (SRP), formerly known as Tech Support Agreement
(TSA). To verify or change your SRP status, contact your Sales Representative or Technical
Support (http://techsupport.osisoft.com/) for assistance.
The OSIsoft Virtual Campus (vCampus) Web site offers a community-oriented program that
focuses on PI System development and integration. The Web site's annual online
subscriptions provide customers with software downloads, resources that include a personal
development PI System, online library, technical webinars, online training, and community-
oriented features such as blogs and discussion forums.
130
Index
Configure PI Web Services to use Kerberos
< Authentication • 111
Configure Required User Accounts • 51
<EventSources> • 120
Configure Secure Web Service Access • 53
<formatters> • 122
Configure Security for .NET Clients • 61
<listeners> • 120
Configure Security for PI Web Services Standalone
<LogFilters> • 122 Edition • 42
<Path to Item> • 8 Configure Security for Web Service Bindings • 55
<Server> • 7 Configure the Data Connection • 100
<Source Designator> • 7 Configure the User Account • 112
Configure the Web Server • 18
A Configure WCFStorm for PI Web Services Access •
About the OSIsoft PI Data Access Suite • 2 32
Absolute Time • 12 Confirm that Client Computer is Using Kerberos •
Add .svc Handler Mapping to IIS • 35 116
Add the Message Size Binding Element • 37 Confirm that Web Server is Using Kerberos • 116
Add/Remove Listeners • 123 Connections that Kerberos Authentication • 52
After Installation • 28 Connections that use Windows Authentication • 52
Allow or Disallow Insertions of Data to a PI System • Connections to PI and AF Collectives • 10
40 Constraint • 9
Allow or Disallow Performance Equation Calls • 40 Control Message Size • 37
Architecture • 3 Control PI Web Services Features • 39
Associate an SPN with the Application Pool Domain Create an SPN • 112
Account • 112 Create and Execute a Snapshot Request • 34
Associate an SPN with the domain account • 113
Automatic WSDL Generation • 13 D
Data Entry Disallowed • 73
B Data Returned as TimeSeries • 92
basicHttpBinding • 54 Design Returned Data Display • 103
basicHttpBinding Sample • 63 Design the Form • 102
Before Installation • 15 Download and Install WCFStorm • 32
Binding Types used by PI Web Services • 54
E
C Edit the Active Binding Configuration • 57
CancelPIUpdates Method • 84 Edit the Endpoint Binding • 56
Category Source Filter • 124 Enable or Disable Impersonation • 58
Change the Date Picker Control • 107 End User Folder and Registry Permissions • 53
Change the Endpoint and Active Configuration Error and Trace Message Logging • 9
Bindings • 56 Example
Classes and Properties • 87, 97 Configure Exceptions on Windows Server 2008
Configure Data Display Returns • 40 SP2 • 69
Configure Duration of Update Sign Ups • 40 Examples • 8
Configure Field Input • 101 Exception to Time Input Translation • 11
Configure Firewall Exceptions • 69 Execution of Performance Equations Disallowed • 74
Configure IIS Application Server Settings • 20 Explicit Sign-ups • 6
Configure IIS on Windows 2003 • 19
G N
GetPIArchiveData Method • 77 netNamedPipeBinding • 55
GetPISnapshotData Method • 80 netNamedPipeBinding Sample • 67
GetPISummaryData Method • 79 netTcpBinding • 55
GetPIUpdates Method • 84 netTcpBinding Sample • 65
GetProductVersion Method • 86 NumValues • 87
H P
Host PI Web Services on a PI WebParts Server • 17 Path • 7
Host PI Web Services with a Windows service • 40 PI Identities and Mappings • 49
PI System Data Types • 9
I PI System Not Found • 72
PI Trusts • 49
If the Service Does Not Start • 43
PI Web Services Interfaces • 77
IIS is Not Running • 71
PI Web Services Programmer Reference • 77
Impersonation and Delegation • 57
PI Web Services Security • 47
Implicit Sign-ups • 6
PIArcDataRequest • 87
In this Guide • 1
PIArcManner • 87
Initial Settings • 119
PIArcMannerBoundaries • 88
InsertPIData Method • 80
PIArcMannerRetrievalType • 88
Install .NET Framework 4 • 17
PIPointType • 97
Install IIS on Windows Server 2003 • 18
PISummaryDataRequest • 89
Install PI Web Services • 15
PISummaryManner • 89
Install PI Web Services Standalone Edition • 41
PISummaryMannerSummaryValue • 90
Insufficient Message Size • 73
PISummaryMannerWeightType • 90
Insufficient Permissions • 73
Prerequisites • 111
Intervals • 89
Priority Filter • 125
Introduction • 1
Properties • 92, 94
Invalid Tag Name • 76
IPISearch Interface • 96
R
IPISearch Web Method • 96
IPITimeSeries Interface • 77 Relative Time • 11
IPITimeSeries Web Methods • 77 Remote Connection Failure • 72
Reserve Namespace on Windows 2003 Server • 42
K Reserve Namespace on Windows 2008 R2 Server,
Windows 7 or Vista • 43
Keyword Filter • 125
Resources • 117
Retrieval of Data Updates • 5
L
Returned Time Stamps • 11
ListPathsByUpdateTicket Method • 86 Review AF Server Requirements • 17
Locate PI Web Services Files • 31 Review ASP.NET ISAPI extensions for .NET 4
Logging and Instrumentation • 119 Framework • 22
132
Review Firewall Setup • 39 Use of Load-Balanced Web Farms • 116
Review Role Services in IIS Server Manager • 22 UseStart • 90
Review Security Configuration • 38
Role of PI Data Services • 6 V
Run Setup Kit • 27 Verify Data Access • 32
Verify Identity Connections • 52
S Verify Standalone Edition Installation • 44
Sample Configuration Files • 62
Secure Access to Data through PI Asset Framework • W
51
WCF Service Configuration Editor • 68
Secure Access to PI Server Data • 48
Web Service Bindings that use Impersonation and
Security Binding Samples • 62 Delegation • 58
Select a Method • 101 Web Service Inputs • 7
Server Error in PI Web Services Application • 75 Windows 7 and Windows Vista • 23
Server Not Found • 72 Windows Server 2003 • 18
Set Maximum Message Size • 38 Windows Server 2008 R2 • 22
Set Required User Permissions • 50 Windows-integrated Security • 48
Set the Domain Account as Trusted for Delegation • wsHttpBinding • 55
113
wsHttpBinding Sample • 64
Sign up for data updates • 5
SignUpForPIUpdates Method • 83
SignUpResult • 95
Silent Installation of PI Web Services • 45
StartTime and EndTime • 91
Summary of Features • 4
Supported Client Platforms • 17
Supported Security Scenarios • 48
System Requirements • 16
T
Technical Support and Resources • 127
Test the Form • 108
Test the Web Server Connection • 29
Time Input Translation Rules • 10
Time Stamps • 10
TimedValue • 94
TimedValueUpdate • 95
TimeRange • 91
TimeSeries • 92
TimeSeriesUpdates • 94
Transition To or From Daylight Savings Time • 91
Troubleshooting • 71, 116
U
Updates • 88, 90
Use InfoPath with PI Web Services • 99
Use of Alternate port numbers • 115
Use of Basic Authentication with SSL • 115
Use of Host Headers • 115