1 Reply Latest reply on Nov 8, 2013 9:08 PM by Bhess

    PIWebservice 2012 - PISoapClient throws "Cannot Connect to server"

    Doddabasappa

      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?