Hi,
I am looking for an example of how to put a node in unmanaged mode using the API. I am developing in C#, but will settle for any example out there.
Anything that will get me in the right direction will be helpful
Thanks in advance!
The SDK documentation includes an example of how to do this in PowerShell.
(1) create a new C# project
(2) add reference to your SW-Orion Webservices as "orion_misc.SWIS.Informa...."
(3) this is part of my code...
....
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
var client = new orion_misc.SWIS.InformationServiceClient("BasicHttpBinding_InformationService",
string.Format("https://{0}:17778/SolarWinds/InformationService/v3/OrionBasic", hostname));
client.ClientCredentials.UserName.UserName = username;
client.ClientCredentials.UserName.Password = password;
client.Open();
client.Close();
internal class ProxyMarshalHelper : IDisposable
{
private readonly MemoryStream _stream;
private readonly XmlTextWriter _writer;
private bool _empty;
public ProxyMarshalHelper()
_stream = new MemoryStream();
_writer = new XmlTextWriter(_stream, Encoding.UTF8);
_empty = true;
}
public void Dispose()
_stream.Dispose();
public void ArgsStart()
_stream.Position = 0;
_stream.SetLength(0);
public XElement[] ArgsEnd()
if (_empty)
return new XElement[0];
_writer.WriteEndElement();
_writer.WriteEndDocument();
_writer.Flush();
XmlTextReader _reader = new XmlTextReader(_stream);
return XDocument.Load(_reader).Elements().First().Elements().ToArray();
public void ArgsAdd(Type argType, object argValue)
_empty = false;
_writer.WriteStartDocument();
_writer.WriteStartElement("params");
DataContractSerializer dcs = new DataContractSerializer(argType);
dcs.WriteObject(_writer, argValue);
public object RetConvert(Type retType, XmlElement retValue)
if (retValue == null)
return null;
DataContractSerializer dcs = new DataContractSerializer(retType);
XPathNavigator navigator = retValue.CreateNavigator();
if (navigator == null)
return dcs.ReadObject(navigator.ReadSubtree(), false);