none
Trying to Create a Proxy Assembly for WCF Services RRS feed

  • Question

  • I am trying to create ProjectServerServices.dll proxy assembly for WCF services. Here are the steps I went through.

    1.I copied and pasted web.config file in  [Program Files]\Microsoft Office Servers\14.0\WebServices\Shared\ProjectServer\PSI.

    2.Copied the web.config.RTM_4RefOnly.txt file from the Documentation\Intellisense\web.config.files and renamed to web.config. 

    3. Did iisreset and ran GenWCFProxyAssembly.cmd.

    I received "The remote couldnot be resolved 'servername'" and '.\Source\*.cs' couldn't found error messages.

    Could you please let me know what's am I doing wrong?

    Wednesday, March 2, 2011 7:03 PM

Answers

  • The proxy source files are already provided in the ~\Documentation\Intellisense\WCF directory of the Project 2010 SDK download. Just unzip Source.zip, which creates Source subdirectory with the *.cs files. Then run the CompileWCFProxyAssembly.cmd script.

    The only time you need to re-create the proxy source files is when Project adds to the PSI services. That may happen in Service Pack 1 (SP1), which is not yet available.

    If and when you do need to regenerate the proxy source files, you need to change the VDIR1  and VDIR2 values for your system, in the GenWCFProxyAssembly.cmd script.

    --Jim


    Jim Corbin [MSFT]
    • Proposed as answer by Jim Corbin Thursday, March 3, 2011 12:01 AM
    • Marked as answer by anate Friday, March 4, 2011 3:27 PM
    Wednesday, March 2, 2011 10:59 PM

All replies

  • The proxy source files are already provided in the ~\Documentation\Intellisense\WCF directory of the Project 2010 SDK download. Just unzip Source.zip, which creates Source subdirectory with the *.cs files. Then run the CompileWCFProxyAssembly.cmd script.

    The only time you need to re-create the proxy source files is when Project adds to the PSI services. That may happen in Service Pack 1 (SP1), which is not yet available.

    If and when you do need to regenerate the proxy source files, you need to change the VDIR1  and VDIR2 values for your system, in the GenWCFProxyAssembly.cmd script.

    --Jim


    Jim Corbin [MSFT]
    • Proposed as answer by Jim Corbin Thursday, March 3, 2011 12:01 AM
    • Marked as answer by anate Friday, March 4, 2011 3:27 PM
    Wednesday, March 2, 2011 10:59 PM
  • Jim,

    Thanks for the reply. I was able to generate ProjectServerServices.dll using CompileWCFProxyAssembly.cmd script. I am trying to create a project using C# code. I couldn't locate the service at http://localhost:32843/ecdd4a06ab64557d5a3fde7a027f4cc09/PSI/Project.svc. I received

    "The server was unable to process the request due to an internal error. ". Could you please let me know.

    Thanks.

    Thursday, March 3, 2011 2:48 AM
  • Here is the error message when I try to access the Project.svc. I am stuck with this.Could you please give me any suggestions?

    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)
    Thursday, March 3, 2011 2:49 PM
  • As you discovered, you can't directly set a reference to Project.svc. You have to go through the PWA front end to the ProjectServer.svc router. For an example, take a look at the CreateProject4Department sample in the Project 2010 SDK download.

    Also, when you are setting a service reference, use the server name, not localhost.

    --jim


    Jim Corbin [MSFT]
    Thursday, March 3, 2011 4:08 PM
  • I received CustomFieldCodeValueDoesNotMatchLookupTable error when I try to use CreateProject4Department sample. I changed app.config to http://servername/pwa/_vti_bin/PSI/ProjectServer.svc. I am using these samples on the same server where Project Server located. Thank you for your help.
    Thursday, March 3, 2011 4:15 PM
  • The GUID of the lookup table value is hardcoded in the example. You need to provide your own value, as described in the comments in the Program.cs file.

    After you use PWA to create some entries in the Departments lookup table, one way to find the GUID of an entry is to use a query in SQL Server Management Studio, for the Reporting DB, e.g.:

    SELECT TOP 100 [LookupMemberUID]
      ,[MemberValue]
      ,[MemberDescription]
     FROM [ProjectServer_Reporting].[dbo].[MSPLT_Department_UserView]
    


    Jim Corbin [MSFT]

    • Proposed as answer by Jim Corbin Friday, March 4, 2011 12:02 AM
    Thursday, March 3, 2011 11:55 PM