如何在项目服务器2010中使用项目Web服务 [英] How to consume project web services in project server 2010

查看:77
本文介绍了如何在项目服务器2010中使用项目Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如何在项目服务器-2010中使用项目Web服务以及如何在visual studio-2010中使用projectdataset。请逐步描述在visual studio-2010中选择了哪个模板。在添加网络参考之后。如何使用网络方法......

How to consume project web services in project server-2010..and how to use projectdataset in visual studio-2010.Please describe step by step and which template is selected in visual studio-2010..after add web references .How to use web method...

Neeraj

推荐答案

请参阅下面的控制台应用程序 示例,它使用Project web sevrice作为Web服务参考&将第一个任务的任务[2]优先级更新为200。它使用Projectdataset&项目类方法。

Please see below console app example which uses the Project web sevrice as web service reference & updates the Task[2] priority of first task to200. It uses the Projectdataset & project class methods.

using System;using System.Diagnostics;using System.Net;using System.Data;using System.Text;using PSIReadProjectData.ProjectWebSvc;using System.Collections.Generic;using System.Web.Services.Protocols;namespace PSIReadProjectData{    class Program    {                static void Main(string[] args)        {                       Class1 obj = new Class1();            try            {                                //bool checkedout = false;                ProjectWebSvc.Project proj = new ProjectWebSvc.Project();                proj.UseDefaultCredentials = true;                Guid projectGuid = new Guid("bb0c6180-185f-4315-851d-f415a7952913"); //Project for which I want to update the Multiline text field                ProjectWebSvc.ProjectDataSet pds = proj.ReadProject(projectGuid, DataStoreEnum.WorkingStore);                                               Guid sessionId = Guid.NewGuid();                Guid jobId = Guid.NewGuid();                                sessionId = Guid.NewGuid();                jobId = Guid.NewGuid();                pds.Task[2].TASK_PRIORITY = 200;                 proj.CheckOutProject(projectGuid, sessionId, "Test checkout");                bool validateOnly = false;                proj.QueueUpdateProject(jobId, sessionId, pds, validateOnly);                proj.QueuePublish(jobId, projectGuid, false, string.Empty);                proj.QueueCheckInProject(jobId, projectGuid,false, sessionId, "Update priority using PSI");                            }                        catch (SoapException ex)            {             }}


希望有所帮助。

Hope that helps.


这篇关于如何在项目服务器2010中使用项目Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆