Project.ReadSchedulingContext Method
Gets the scheduling context based on a set of projects and resources.
Namespace: WebSvcProject
Assembly: ProjectServerWebServices (in ProjectServerWebServices.dll)
Syntax
'Declaration
<SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/Project/ReadSchedulingContext", RequestNamespace := "http://schemas.microsoft.com/office/project/server/webservices/Project/", _
ResponseNamespace := "http://schemas.microsoft.com/office/project/server/webservices/Project/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function ReadSchedulingContext ( _
projectUids As Guid(), _
resourceUids As Guid() _
) As ProjectContextDataSet
'Usage
Dim instance As Project
Dim projectUids As Guid()
Dim resourceUids As Guid()
Dim returnValue As ProjectContextDataSet
returnValue = instance.ReadSchedulingContext(projectUids, _
resourceUids)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/Project/ReadSchedulingContext", RequestNamespace = "http://schemas.microsoft.com/office/project/server/webservices/Project/",
ResponseNamespace = "http://schemas.microsoft.com/office/project/server/webservices/Project/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public ProjectContextDataSet ReadSchedulingContext(
Guid[] projectUids,
Guid[] resourceUids
)
Parameters
- projectUids
Type: []
Array of project GUIDs.
- resourceUids
Type: []
Array of resource GUIDs.
Return Value
Type: WebSvcProject.ProjectContextDataSet
ProjectContextDataSet containing the scheduling context derived from the specified projects and resources.
Remarks
Gets a list of projects related to specified projects or resources. A relationship exists if one of the following conditions is met:
Projects share enterprise resources (either those on the project team or in the input list)
Projects have inter-project dependencies (cross-project links)
Projects share resources with or have cross-project links with projects that are related to projects in the input list (an indirect relationship)
Project Server Permissions
Permission |
Description |
Can open the specified projects. Category permission. |
Examples
Consider two projects that share one enterprise resource, as in the following table.
Project name and GUID |
Resources and GUIDs |
---|---|
Project1 f0e98e26-2c9c-4f74-b40a-640f3f3f03f5 |
Resource1; d58fd816-d380-46e3-aff1-6cef617d32a2 Resource2; b3dab395-bc33-4dd7-a3a7-a45522857369
|
Project2 a9d03b87-37f1-473d-90f6-77ba3c521a40 |
Resource1; d58fd816-d380-46e3-aff1-6cef617d32a2
|
In the following code fragment for a test application, WebSvcProject is an arbitrary name for a reference to the Project Web service, and project is an initialized instance of the WebSvcProject.Project class.
try
{
Guid[] projectUids = { new Guid("a9d03b87-37f1-473d-90f6-77ba3c521a40") };
Guid[] resourceUids = null;
WebSvcProject.ProjectContextDataSet dsProjectContext =
project.ReadSchedulingContext(projectUids, resourceUids);
dsProjectContext.WriteXml(@"C:\Tests\SchedulingContextOut.txt");
}
catch (SoapException ex)
{
. . .
}
The value of the Relationship element in the SchedulingContextOut.txt file shows that Project2 is related to Project1 by a shared resource. If you add one or both resource GUIDs to the resourceUids array, the result is the same.
Note
If you add both project GUIDs to the projectUids array, dsProjectContext is empty.
<?xml version="1.0" standalone="yes"?>
<ProjectContextDataSet xmlns="http://schemas.microsoft.com/office/project/server/webservices/ProjectContextDataSet/">
<Relationships>
<PROJ_UID>a9d03b87-37f1-473d-90f6-77ba3c521a40</PROJ_UID>
<RelatedTo_UID>f0e98e26-2c9c-4f74-b40a-640f3f3f03f5</RelatedTo_UID>
<RelatedTo_NAME>Project1</RelatedTo_NAME>
<Relationship>2</Relationship>
<HasBuildTeamPermission>true</HasBuildTeamPermission>
</Relationships>
</ProjectContextDataSet>