5 Replies Latest reply on Jul 15, 2013 1:10 PM by mhamel

    Elements are returned for multiple times depending on the depth of the tree for AF Web service

    cw.ng

      Hi,

       

      I have encountered the problem that the same element is returned for multiple times depending on the depth of the tree for AF Web Service.

       

      For example, we have tree having depth equals to 5. It will return 5 identical elements.

      ns2:Id ns2:Path ns2:Name ns2:Level
      cebf8c3c-b281-4a6b-8b81-412af610c142 af:\\SERVER\DC\D Center\ABC\Zone A\Cabinets\A01.01 A01.01 4
      cebf8c3c-b281-4a6b-8b81-412af610c142 af:\\SERVER\DC\D Center\ABC\Zone A\Cabinets\A01.01 A01.01 3
      cebf8c3c-b281-4a6b-8b81-412af610c142 af:\\SERVER\DC\D Center\ABC\Zone A\Cabinets\A01.01 A01.01 2
      cebf8c3c-b281-4a6b-8b81-412af610c142 af:\\SERVER\DC\D Center\ABC\Zone A\Cabinets\A01.01 A01.01 1
      cebf8c3c-b281-4a6b-8b81-412af610c142 af:\\SERVER\DC\D Center\ABC\Zone A\Cabinets\A01.01 A01.01 0

       In addition, because of the above issues, the level returned from the web service cannot reflect the actual level from the hierarchy even though we set the ChildElementDepth to a big number.

       

      Please advise. 

        • Re: Elements are returned for multiple times depending on the depth of the tree for AF Web service
          mhamel

          @Chung: I will need more precision on what you have tried, like which web methods did you invoke for this. Can you share the constraints you used with the query?

           

          I tried a couple of combinations on my side but I had no success to reproduce your problem.

            • Re: Elements are returned for multiple times depending on the depth of the tree for AF Web service
              cw.ng

              Hi,

               

              I was calling the FindElements Web service with two parameters (RootPath and ChildElementDepth). We put af:\\SERVER\Database as rootPath while put 10 in the childElementDepth.

               

              Because we want to extract all the elements out to construct the hierarchy in our application.

               

              In our AF Database, we have few hierarchies having 2-3 levels and also have a data model having some data reference. The data model should have around 6 levels.

               

              I hope you can reproduce this problem.

               

              Let me know if you want more information.

               

              Thanks in advance.

               

               

               

               

               

               

               

               

               

               

                • Re: Elements are returned for multiple times depending on the depth of the tree for AF Web service
                  mhamel

                  @Chung: I have made some other tests based on the parameters you have confirmed, and I have found that referenced elements whatever there locations are also returned by the FindElements web method. In my case, I have tried with models and referenced elements under elements with the same result.

                   

                  I could distinguish them by the path returned by the web method. Could you capture the raw results of your example sent by PI Web Services via a WCF client such as WCFStorm or SoapUI and post it back?

                   

                  You can use the following xml object to send to your endpoint to get the test done.

                   

                   

                   
                  <FindElements>
                    <MethodParameters>
                      <Constraints>
                        <RootPath>af:\\SERVER\DC\D Center\ABC\Zone A\Cabinets\A01.01</RootPath>
                        <NameMask isNull="false" />
                        <TemplateNames isNull="true" />              
                        <AllowMatchOnDerivedTemplates>False</AllowMatchOnDerivedTemplates>
                        <CategoryNames isNull="true" />              
                        <AttributeFilters isNull="true" />              
                      </Constraints>
                      <Manner>
                        <IncludeTemplateName>False</IncludeTemplateName>
                        <ChildElementDepth>10</ChildElementDepth>
                        <FlatHierarchy>false</FlatHierarchy>
                      </Manner>
                    </MethodParameters>
                  </FindElements>