Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Reading projects from project online with psi

$
0
0

Hi

I have a project online environment setup which I can successfully connect to using CSOM. I can read resources and update resource values. I noticed that when I create a new user I can cannot find a way to update the resource rate and the logon account fields using the CSOM so I have resorted to using the PSI. I am using the proxy file wcf.Resource.cs file as my proxy to the online instance. I have configured my endpoint manually using code because I need to specifiy a username and password to login and retrieve the list of resources. When I call the method to read resources below. I get an unhandled communication fault. I'm guessing that it has something to do with my authentication into the project online.

var resources = resourceClient.ReadResources(""false);

This is how I configure my endpoint.

const int MAXSIZE = 500000000;// Create a basic binding that can be used for HTTP or HTTPS.BasicHttpBinding binding = new BasicHttpBinding();

binding.Name = "basicHttpConf";
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.Realm = "";
binding.SendTimeout = TimeSpan.MaxValue;
binding.MaxReceivedMessageSize = MAXSIZE;
binding.ReaderQuotas.MaxNameTableCharCount = MAXSIZE;
binding.MessageEncoding = WSMessageEncoding.Text;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;

resourceClient = new SvcResource.ResourceClient(binding, new EndpointAddress("https://mywebsite.com/sites/pwa/_vti_bin/PSI/ProjectServer.svc"));

resourceClient.ClientCredentials.UserName.UserName = "myemailaddress";
resourceClient.ClientCredentials.UserName.Password = "pwd";

Any help on why I would be getting the error would be appreciated. 


Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>