Doddabasappa

PIWebservice 2012 - PISoapClient throws "Cannot Connect to server"

Discussion created by Doddabasappa Champion on Nov 8, 2013
Latest reply on Nov 8, 2013 by Bhess

Hi,

 

I used PIWebservice 2012 and PISoapClient to connect and get values from AFServer. The following is my code

 

PISoapServiceClient sClient = new PISoapServiceClient();
        sClient.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
       
        ElementSearchManner manner = new ElementSearchManner();
        manner.FlatHierarchy = true;

 

string[] paths = new string[1] { "af:\\<ServerName>\RootName\Element" };
        Element[] elements = sClient.GetElementsByPaths(paths, manner);

 

 

 

        foreach (Element ele in elements)
            ListBox1.Items.Add(ele.Name);

 

@ GetElementsByPath, it throws Cannont connect to server error. I was able to connect to same server using AF SDK's, but while using WebService it throws this error.

 

Please let me know what will be issue and how can it be resolved?

 

 

Outcomes