This is an example in .NET (C#) and is used to show how to access the XMLMSG interface from your program. It first prints all users and then sets the password for the user \\default\user to 123.
Note: Replace dbsecret in the example below with the appropriate database secret.
using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using System.Xml; namespace XMLMSG_CSharp { class Program { static string url = "http://server/xmlmsg"; static string secret = "dbsecret"; static XmlDocument PostCommand(XmlDocument doc) { byte[] data; { MemoryStream s = new MemoryStream(); doc.Save(s); data = s.GetBuffer(); } HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); req.Method = "POST"; req.ContentType = "text/xml"; req.ContentLength = data.Length; { Stream s = req.GetRequestStream(); s.Write(data, 0, data.Length); s.Flush(); } HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); if (resp.StatusCode != HttpStatusCode.OK) throw new Exception(); doc = new XmlDocument(); doc.Load(XmlReader.Create(resp.GetResponseStream())); return doc; } static void DbSecret(XmlElement node) { node.SetAttribute("secret", secret); } static void Main(string[] args) { { // print all users XmlDocument doc = new XmlDocument(); XmlElement node; doc.AppendChild(node = doc.CreateElement("queryDatabase")); DbSecret(node); node.AppendChild(doc.CreateElement("user")); PostCommand(doc).Save(Console.Out); } { // set password "123" for \\default\user XmlDocument doc = new XmlDocument(); XmlElement node; doc.AppendChild(node = doc.CreateElement("manipulateDatabase")); DbSecret(node); node.AppendChild(node = doc.CreateElement("updateUser")); node.SetAttribute("mode", "update"); node.SetAttribute("domain", "default"); node.SetAttribute("name", "user"); node.AppendChild(node = doc.CreateElement("password")); node.AppendChild(doc.CreateTextNode("123")); PostCommand(doc).Save(Console.Out); } } } }