public Workspace CreateWorkspace(Workspace workspace)
        {
            var      invoker = new SoapInvoker(this);
            XElement msg     = invoker.CreateEnvelope("CreateWorkspace");

            msg.Add(workspace.ToXml(MessageNs + "workspace"));
            XElement result = invoker.InvokeResult();

            return(Workspace.FromXml(this, result));
        }
        public Workspace QueryWorkspace(string ownerName, string workspaceName)
        {
            var      invoker = new SoapInvoker(this);
            XElement msg     = invoker.CreateEnvelope("QueryWorkspace");

            msg.Add(new XElement(MessageNs + "workspaceName", workspaceName));
            msg.Add(new XElement(MessageNs + "ownerName", ownerName));

            XElement result = invoker.InvokeResult();

            return(Workspace.FromXml(this, result));
        }
        public Workspace UpdateWorkspace(string oldWorkspaceName, string ownerName,
                                         Workspace newWorkspace)
        {
            var      invoker = new SoapInvoker(this);
            XElement msg     = invoker.CreateEnvelope("UpdateWorkspace");

            msg.Add(new XElement(MessageNs + "oldWorkspaceName", oldWorkspaceName));
            msg.Add(new XElement(MessageNs + "ownerName", ownerName));
            msg.Add(newWorkspace.ToXml(MessageNs + "newWorkspace"));

            XElement result = invoker.InvokeResult();

            return(Workspace.FromXml(this, result));
        }
Пример #4
0
        public Workspace CreateWorkspace(Workspace workspace)
        {
            Message msg = new Message(GetWebRequest(new Uri(Url)), "CreateWorkspace");

            workspace.ToXml(msg.Body, "workspace");

            Workspace newWorkspace;

            using (HttpWebResponse response = Invoke(msg))
            {
                XmlReader results = msg.ResponseReader(response);
                newWorkspace = Workspace.FromXml(this, results);
            }

            return(newWorkspace);
        }
Пример #5
0
        public Workspace QueryWorkspace(string workspaceName, string ownerName)
        {
            Message msg = new Message(GetWebRequest(new Uri(Url)), "QueryWorkspace");

            msg.Body.WriteElementString("workspaceName", workspaceName);
            msg.Body.WriteElementString("ownerName", ownerName);

            Workspace workspace;

            using (HttpWebResponse response = Invoke(msg))
            {
                XmlReader results = msg.ResponseReader(response);
                workspace = Workspace.FromXml(this, results);
            }

            return(workspace);
        }
Пример #6
0
        public Workspace[] QueryWorkspaces(string workspaceName, string ownerName,
                                           string computer)
        {
            Message msg = new Message(GetWebRequest(new Uri(Url)), "QueryWorkspaces");

            if (!String.IsNullOrEmpty(workspaceName))
            {
                msg.Body.WriteElementString("workspaceName", workspaceName);
            }
            if (!String.IsNullOrEmpty(ownerName))
            {
                msg.Body.WriteElementString("ownerName", ownerName);
            }
            if (!String.IsNullOrEmpty(computer))
            {
                msg.Body.WriteElementString("computer", computer);
            }

            List <Workspace> workspaces = new List <Workspace>();

            using (HttpWebResponse response = Invoke(msg))
            {
                XmlReader results = msg.ResponseReader(response);

                while (results.Read())
                {
                    if (results.NodeType == XmlNodeType.Element &&
                        results.Name == "Workspace")
                    {
                        workspaces.Add(Workspace.FromXml(this, results));
                    }
                }
            }

            workspaces.Sort();
            return(workspaces.ToArray());
        }
        public List <Workspace> QueryWorkspaces(string ownerName, string computer)
        {
            var      invoker = new SoapInvoker(this);
            XElement msg     = invoker.CreateEnvelope("QueryWorkspaces");

            if (!string.IsNullOrEmpty(ownerName))
            {
                msg.Add(new XElement(MessageNs + "ownerName", ownerName));
            }
            if (!string.IsNullOrEmpty(computer))
            {
                msg.Add(new XElement(MessageNs + "computer", computer));
            }

            List <Workspace> workspaces = new List <Workspace>();
            XElement         result     = invoker.InvokeResult();

            workspaces.AddRange(result.Elements(MessageNs + "Workspace").Select(el => Workspace.FromXml(this, el)));
            workspaces.Sort();
            return(workspaces);
        }