none
PSI in Project Server 2010 RRS feed

Answers

  • The Walkthrough: Developing PSI Applications Using WCF article is fairly complex, because there are so many options in developing with WCF services in Project Server. There are three ways to add a WCF service reference, and there are two ways (or three, if you use the Service Configuration Editor, as in Procedure 4) to set a WCF endpoint.

    Try another approach where the configuration is already done, such as:

    1. Install the Project 2010 SDK download. It's easiest to install to a directory such as C:\Project_SDK, rather than the default directory, to avoid permission issues when using the VS samples.
    2. Unzip the Documentation\Intellisense\WCF\Source.zip to the local directory, and then run the CompileWCFProxyAssembly command in a Visual Studio Command Prompt window. That creates the ProjectServerServices.dll proxy assembly.
    3. Open the Samples\ManagedCodeReference\CreateProject4Department.sln solution in Visual Studio 2010.

      You should work on a test installation of Project Server, if possible. For many applications (except workflows, or modifying PWA or project sites), you can develop on an external computer, but you then must copy the Microsoft.Office.Project.Server.Library.dll assembly and the ProjectServerServices proxy assembly to the remote computer.
    4. Set a reference to the ProjectServerServices.dll proxy assembly that you created in step 2, and ensure the Microsoft.Office.Project.Server.Library reference is valid.
    5. In the app.config file, change the endpoint addresses to use the correct server name and PWA name, for the ProjectServer.svc endpoint.
    6. In Program.cs, change the directory name for OUTPUT_FILES, if you want.
    7. Create one or more departments in the Department lookup table (use http://ServerName/pwa/_layouts/PWA/Admin/EditLookupTable.aspx?_guid=e7397277-1ab0-4096-b2dd-57029a055ba4), and then find the GUID of one of the departments, as described in Program.cs. Change the value of the DEPARTMENT_TEST constant.
    8. Compile and run the program.

    You should see the following output in the Command window:

    XML output of the ProjectDataSet before QueueCreateProject:
        C:\Project\Samples\Output\ProjectDataSet4Department_before.xml
    Creating project: Test Dept 1
    Waiting for job: ProjectCreate .................................................
    
    XML output of the ProjectDataSet after ReadProject:
        C:\Project\Samples\Output\ProjectDataSet4Department_after.xml
    
    Press any key to exit...

    If you get errors, check that you have correct permissions to access PWA and create projects. Also check the ULS logs.

    --Jim


    Jim Corbin [MSFT]
    • Proposed as answer by Jim Corbin Tuesday, December 7, 2010 10:22 PM
    • Marked as answer by Joao P. Costa Thursday, December 9, 2010 4:44 PM
    Tuesday, December 7, 2010 10:00 PM

All replies

  • I found out that the WebService is located in:

    http://localhost:32843/2e7fdcb814564cfa8fdec90952469dce/PSI/Project.svc

    But I still get the error:

    The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

    Tuesday, December 7, 2010 3:58 PM
  • Tuesday, December 7, 2010 4:19 PM
  • Try the following:

     http://<servername>/pwa/_vti_bin/PSI/project.asmx 

     


    Bad Request: Page cannot be found.

    I really can't understand the PSI from 2010...

    Tuesday, December 7, 2010 4:38 PM
  • Because the ASMX interface is based on WCF in Project Server 2010, you need to use the ?wsdl suffix:

    http://<servername>/pwa/_vti_bin/psi/project.asmx?wsdl

    If you use: http://<servername>:32843/<Project Server service GUID>/psi/project.svc, or with the ?wsdl suffix, you get a service error, because the WCF interface is accessible only through the ProjectServer.svc router service on the PWA front end (unless you modify the web.config file for PWA, as described in How to: Create a Proxy Assembly for WCF Services -- which is a bad idea on a production server).

    That's why you need to use a proxy file or proxy assembly, as described in the SDK, and then set WCF endpoints through ProjectServer.svc. Or, use the ASMX interface. See Overview of WCF and the PSI.

    --Jim

     


    Jim Corbin [MSFT]
    Tuesday, December 7, 2010 4:47 PM
  • Because the ASMX interface is based on WCF in Project Server 2010, you need to use the ?wsdl suffix:

    http://<servername>/pwa/_vti_bin/psi/project.asmx?wsdl

    If you use: http://<servername>:32843/<Project Server service GUID>/psi/project.svc, or with the ?wsdl suffix, you get a service error, because the WCF interface is accessible only through the ProjectServer.svc router service on the PWA front end (unless you modify the web.config file for PWA, as described in How to: Create a Proxy Assembly for WCF Services -- which is a bad idea on a production server).

    That's why you need to use a proxy file or proxy assembly, as described in the SDK, and then set WCF endpoints through ProjectServer.svc. Or, use the ASMX interface. See Overview of WCF and the PSI.

    --Jim

     


    Jim Corbin [MSFT]

    I'm using the Project Server Starter Pack. The solution WorkspaceProjectCFWP has service references that do not work at all because they are mapped to the original developer machine. When i try to add another service reference, I just don't know how. I have simply tried everything. In this tutorial http://msdn.microsoft.com/en-us/library/ee767691.aspx I followed it step-by-step and in the service reference...the same problem.

    This was a lot easier in 2007. Is there some moron guide that can teach how to develop from scratch a feature using PSI 2010?

    Thanks

     

    Tuesday, December 7, 2010 5:33 PM
  • If you use: http://<servername>:32843/<Project Server service GUID>/psi/project.svc, or with the ?wsdl suffix, you get a service error, because the WCF interface is accessible only through the ProjectServer.svc router service on the PWA front end (unless you modify the web.config file for PWA, as described in How to: Create a Proxy Assembly for WCF Services -- which is a bad idea on a production server).

     


    Jim Corbin [MSFT]


    Tried this and when i try to access the web service I get the following error:

    An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
    System.InvalidOperationException: An exception was thrown in a call to a policy export extension.
    Extension: System.ServiceModel.Channels.TransportSecurityBindingElement
    Error: Security policy export failed. The binding contains a TransportSecurityBindingElement but no transport binding element that implements ITransportTokenAssertionProvider. Policy export for such a binding is not supported. Make sure the transport binding element in the binding implements the ITransportTokenAssertionProvider interface. ----> System.InvalidOperationException: Security policy export failed. The binding contains a TransportSecurityBindingElement but no transport binding element that implements ITransportTokenAssertionProvider. Policy export for such a binding is not supported. Make sure the transport binding element in the binding implements the ITransportTokenAssertionProvider interface.
      at System.ServiceModel.Channels.TransportSecurityBindingElement.System.ServiceModel.Description.IPolicyExportExtension.ExportPolicy(MetadataExporter exporter, PolicyConversionContext policyContext)
      at System.ServiceModel.Description.MetadataExporter.ExportPolicy(ServiceEndpoint endpoint)
      --- End of inner ExceptionDetail stack trace ---
      at System.ServiceModel.Description.MetadataExporter.ExportPolicy(ServiceEndpoint endpoint)
      at System.ServiceModel.Description.WsdlExporter.ExportEndpoint(ServiceEndpoint endpoint, XmlQualifiedName wsdlServiceQName)
      at System.ServiceModel.Description.WsdlExporter.ExportEndpoints(IEnumerable`1 endpoints, XmlQualifiedName wsdlServiceQName)
      at System.ServiceModel.Description.ServiceMetadataBehavior.MetadataExtensionInitializer.GenerateMetadata()
      at System.ServiceModel.Description.ServiceMetadataExtension.EnsureInitialized()
      at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.InitializationData.InitializeFrom(ServiceMetadataExtension extension)
      at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.GetInitData()
      at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.TryHandleDocumentationRequest(Message httpGetRequest, String[] queries, Message& replyMessage)
      at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.ProcessHttpRequest(Message httpGetRequest)
      at SyncInvokeGet(Object , Object[] , Object[] )
      at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
      at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
      at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
      at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
      at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
    Tuesday, December 7, 2010 6:09 PM
  • The Walkthrough: Developing PSI Applications Using WCF article is fairly complex, because there are so many options in developing with WCF services in Project Server. There are three ways to add a WCF service reference, and there are two ways (or three, if you use the Service Configuration Editor, as in Procedure 4) to set a WCF endpoint.

    Try another approach where the configuration is already done, such as:

    1. Install the Project 2010 SDK download. It's easiest to install to a directory such as C:\Project_SDK, rather than the default directory, to avoid permission issues when using the VS samples.
    2. Unzip the Documentation\Intellisense\WCF\Source.zip to the local directory, and then run the CompileWCFProxyAssembly command in a Visual Studio Command Prompt window. That creates the ProjectServerServices.dll proxy assembly.
    3. Open the Samples\ManagedCodeReference\CreateProject4Department.sln solution in Visual Studio 2010.

      You should work on a test installation of Project Server, if possible. For many applications (except workflows, or modifying PWA or project sites), you can develop on an external computer, but you then must copy the Microsoft.Office.Project.Server.Library.dll assembly and the ProjectServerServices proxy assembly to the remote computer.
    4. Set a reference to the ProjectServerServices.dll proxy assembly that you created in step 2, and ensure the Microsoft.Office.Project.Server.Library reference is valid.
    5. In the app.config file, change the endpoint addresses to use the correct server name and PWA name, for the ProjectServer.svc endpoint.
    6. In Program.cs, change the directory name for OUTPUT_FILES, if you want.
    7. Create one or more departments in the Department lookup table (use http://ServerName/pwa/_layouts/PWA/Admin/EditLookupTable.aspx?_guid=e7397277-1ab0-4096-b2dd-57029a055ba4), and then find the GUID of one of the departments, as described in Program.cs. Change the value of the DEPARTMENT_TEST constant.
    8. Compile and run the program.

    You should see the following output in the Command window:

    XML output of the ProjectDataSet before QueueCreateProject:
        C:\Project\Samples\Output\ProjectDataSet4Department_before.xml
    Creating project: Test Dept 1
    Waiting for job: ProjectCreate .................................................
    
    XML output of the ProjectDataSet after ReadProject:
        C:\Project\Samples\Output\ProjectDataSet4Department_after.xml
    
    Press any key to exit...

    If you get errors, check that you have correct permissions to access PWA and create projects. Also check the ULS logs.

    --Jim


    Jim Corbin [MSFT]
    • Proposed as answer by Jim Corbin Tuesday, December 7, 2010 10:22 PM
    • Marked as answer by Joao P. Costa Thursday, December 9, 2010 4:44 PM
    Tuesday, December 7, 2010 10:00 PM
  • hi,

    1. Can I use PSI (WCF Interface based) and create a normal class library solution? not the WCF class library..

    2. I have created on such class library but i get the following exception:

     

    Could not find default endpoint element that references contract 'SvcSecurity.Security' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

     

    The code build's fine and I can use all the web services as well but the problem is the excetion above..

    Basically I am not able to connect to the Project Server.

    Wednesday, January 5, 2011 2:03 PM
  • If by "normal class library" you mean a class library that doesn't require an app.config or web.config file, you can:


    Jim Corbin [MSFT]
    Wednesday, January 5, 2011 4:08 PM
  • Hi Jim,

    Thanks for the reply..

    1. I have implemented the step as per the Walkthrough: Developing PSI Applications Using WCF  article.

    2.  I have also created the ProjectServerServices DLL and added a reference of this DLL to my solution.

     

    But I still get this error..

     

    Friday, January 7, 2011 3:48 AM