3 Replies Latest reply on May 26, 2017 1:40 PM by tdanner

    how to List Resource using C# and orion sdk

    eherrera2528

      I was checking the thread: List Resources By C# Orion SDK?  but when i go to execute the list resource i don't have answer when i go to execute a list resource with the next code:

       

       

              public JToken GetInterfaces(ISwisClient swisClient, int nodes)

              {

                  try

                  {

                      int[] arrnode = new int[1];

                      arrnode[0] = nodes;

                      JToken invokeResult = swisClient.InvokeAsync("Orion.NPM.Interfaces", "DiscoverInterfacesOnNode", arrnode[0]).Result;

                      return invokeResult;

                  }

                  catch (Exception e)

                  {

                      return 0;

                  }

              }

       

      But it never goes over the return sentence, and neither enters the catch sentence.

       

      with the add node, i can have a good experience. But in this moment i can't continue.

       

      robdogaz thanks for your help.

       

      Can you please help me?.

        • Re: how to List Resource using C# and orion sdk
          tdanner

          There are really only three possibilities: the method returns, the method throws an exception, or the method is still running. DiscoverInterfacesOnNode can take a little while for a device with a lot of interfaces. If you run it in the debugger and hit "Break", where is it? Does anything interesting show up in the visual studio debugger output window?

            • Re: how to List Resource using C# and orion sdk
              eherrera2528

              Hi tdanner,

               

              First of all, thanks for your support. I'll explain what I've done, but first I'll answer your questions:

              1. When I debug and I put the break point does not reach the return invokeResult.

              2. I do not see anything interesting, even in the result, the maximum I got was to the following line: return SwisCallAsync (client => client.PostAsync (string.Format ("Invoke / {0} / {1}", entity , Verb), MakeHttpContent (args))); Which is part of the SwisClient.cs class and up to here don't have to be modified, right?

               

              I finally decided to embed Powershell inside C # to execute the two actions (Add Node and DiscoveryInterfacesOnNode). But it is not a suitable way. I am analyzing if I can directly enter to create a SOAP service structure like the SWQL has, but I really see a long way there, can you please tell me how to make a decision ?, if you prefer I can move my question in another post?, Because I see that I am diverting a little from this topic, right ?. I am very grateful if you can give me a light with this situation because for me it is very complicated to understand how SWQL works internally, or do you know if there is technical documentation of this development (SWQL)?