AnsweredAssumed Answered

Connecting to AF Server using AF SDK

Question asked by SPB04@PSEG.com on Apr 6, 2015
Latest reply on Apr 8, 2015 by bshang

Hi Team,

 

I am trying to connect to AF Server using AF SDK .NET program & it's showing me below errors.

 

Note: I am able to connect to AF Server successfully using PI System Explorer. Also, I am able to connect to PI Server successfully using PI SDK.

 

2015-04-06 15:04:45 ;  ; Unable to connect as admin ;  ; System.ServiceModel.CommunicationException: Cannot connect to server 'AF SERVER'. It may be that the impersonated client user account cannot be delegated to the remote AF Server. ---> System.ServiceModel.Security.SecurityNegotiationException: The server has rejected the client credentials. ---> System.Security.Authentication.InvalidCredentialException: The server has rejected the client credentials. ---> System.ComponentModel.Win32Exception: The logon attempt failed

  --- End of inner exception stack trace ---

  at System.Net.Security.NegoState.ProcessReceivedBlob(Byte[] message, LazyAsyncResult lazyResult)

  at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)

  at System.Net.Security.NegoState.CheckCompletionBeforeNextSend(Byte[] message, LazyAsyncResult lazyResult)

  at System.Net.Security.NegoState.ProcessReceivedBlob(Byte[] message, LazyAsyncResult lazyResult)

  at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)

  at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)

  at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)

  at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)

  --- End of inner exception stack trace ---

 

 

Server stack trace:

  at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)

  at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)

  at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)

  at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)

  at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)

  at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)

  at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)

  at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

  at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)

  at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

 

 

Exception rethrown at [0]:

  at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

  at System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout)

  at System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout)

  at OSIsoft.AF.Support.AFProxy.Reconnect(Boolean autoPrompt, Boolean raiseEvents, AFConnectionProtocol protocol, String host, Int32 port, String accountName, TimeSpan timeout)

  --- End of inner exception stack trace ---

  at OSIsoft.AF.Support.AFProxy.Reconnect(AFCollectiveMember member, Boolean autoPrompt, Boolean raiseEvents, AFConnectionPreference preference)

  at OSIsoft.AF.Support.AFProxy.Connect(AFCollectiveMember member, Boolean userSpecified, Boolean updatePreference, Int32 numRetries, IWin32Window owner, AFConnectionPreference preference)

  at OSIsoft.AF.PISystem.Connect(NetworkCredential credential, AFConnectionPreference preference)

  at AFTreeBuilder.Module1.Main()

Outcomes