As for the first question, how are you specifying the path to the tag? Also what happens if you grant read and write permissions on the tag to the identity that is being mapped from the AD user? You would also need to make sure that WIS is selected as the highest on the list of authentication on the PI server (any connection manager menu).
And for the second question, do you see any messages corresponding to the very first attempt of connecting to the PI server or nothing at all? When using trusts, do you disconnect and reconnect to the PI Server?
The path = "pi:\\piservername\tagname"
The read/write permissions are already mapped to the PI Identity of which the AD user is a member. I am not sure what you mean by WIS.
Secondly, I don't see any messages at all with AD authentication method. For trust, I do see messages when user connects/disconnects.
The pi webservice is installed on a server other than PI server.
WIS means Windows Integrated Security. Using mappings to map Windows users/groups to PI Identities, means that you are using WIS
You should see some message from the PI server message log even if you are using mappings of AD user to PI Identities. One of the messages is generated by PI Net Manager when I have test a connection myself:
Successful login ID: 20. Address: . Name: w3wp.exe. Identity List: PIEngineers | PIWorld. Environment Username : NT AUTHORITY\NETWORK SERVICE. Method: Windows Login (SSPI,NTLM)
We can see the list of PI Identities that the incoming connection is mapped to. You can double check the PI Identities that the application gets trusted as from here.
The error message "Malformed path" does suggest that it is a problem with the path definition in the request, which is weird since what you are using is ok. Where are you invoking PI Web Services from? Your own program based on VB.Net or C#? or some Web Services Analysing/Testing Tools?
Thanks Han! Good to hear from you.
Actually, the webservice is hosted on a separate server and has an AD account attached to it in ISS. This AD account is a member of a AD group which is attached to an PI Identity. With this set up I am not able to see any message for successful login in PI SMT. I was wondering if you are using some different set up.
Is it possible to give a sample code snippet for IsertPIData() ? I am not a regular programmer so it will be helpful. I found one for GetPIArchivedata method but that method is quite different from IsertPIData method.
Consider the following code, assuming that _proxy is the Web service client proxy you created (you can use the same as you used for you GetPIArchiveData call):
// Create an array of TimeSeries object
// and populate it with 1 TimeSeries
TimeSeries tss = new TimeSeries;
TimeSeries ts = new TimeSeries();
tss = ts;
// Create an array of TimedValue objects
// and populate it with 1 TimedValue
TimedValue tvs = new TimedValue;
TimedValue tv = new TimedValue();
tvs = tv;
// Populate the TimeSeries with the TimedValue
ts.TimedValues = tvs;
// Set the Path for the TimeSeries
// (could be done on the individual TimedValue instead)
ts.Path = txtPath.Text;
// Set the Value and Timestamp for the TimedValue
tv.Time = DateTime.Parse(txtTimestamp.Text);
tv.Value = txtValue.Text;
// Call the method and return eventual errors
errors = _proxy.InsertPIData(tss, InsertPIDataDuplicateSwitch.InsertDuplicate);
Then you need to handle errors, if any, returned by the web service call:
// The web service returns a single TimeSeries.
// Any entries in this TimeSeries denote failed insertions.
// The series status property will have a count of successful insertions.
// An array of length zero is returned if everything succeeds.
if (errors.TimedValues.Length > 0)
// Do something with errors with 'errors.ErrDesc'
// and any individual TimedValue in 'errors.TimedValues'
// All insertions succeeded;
Note, this is for demonstration purposes... you need to make sure you implement appropriate error handing (try..catch), at least around the web service call.
Hope this helps!
Thanks! That was helpful :)