2 Replies Latest reply on Nov 15, 2013 7:33 AM by uidzer0

    Help with out of the box VBClient Example


      I'm trying to build the example provided in the 1.7 version of the SDK and can't get the project to build.


      Here's the error:  Error 1 Value of type '1-dimensional array of System.Xml.XmlElement' cannot be converted to 'VBClient.SolarWinds.InformationService.ArrayOfXmlElement'. C:\Program Files (x86)\SolarWinds\Orion SDK\Samples\VBClient\Module1.vb 65 70 VBClient


      I've tried many different ways to get around the problem.  Creating my own instance of ArrayyOfXmlElement and populating it with the xmlelement data converted to xelement, etc.  But i just can't get beyond this.  Someone please help me understand what's wrong.



        • Re: Help with out of the box VBClient Example

          Looks like something has changed and broken that sample. Here's an updated version of the AcknowledgeAlert sub that works for me with current Visual Studio:


              Sub AcknowledgeAlert(ByVal swis As InformationServiceClient, ByVal ParamArray alerts() As AlertInfo)

                  Dim dcs As New DataContractSerializer(GetType(AlertInfo()))

                  Dim doc As New XDocument()

                  Using writer As XmlWriter = doc.CreateWriter

                      dcs.WriteObject(writer, alerts)

                  End Using


                  Dim arguments As New ArrayOfXmlElement



                  Dim result As XElement

                  result = swis.Invoke("Orion.AlertStatus", "Acknowledge", arguments)



              End Sub