none
Error message with PSI extension RRS feed

  • Question

  • I wrote a PSI extension to create the Project in Project Server. I am testing this service using Stand alone application. I get this error message : "The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8)." I was able to test my service using Internet Explorer. Could you please suggest what could be wrong?
    Thursday, March 10, 2011 4:52 PM

Answers

  • yes you may just be getting a general sharepoint error message web page. Thus it will be of type text/html and not the text/xml the PSI is expecting. If you have fiddler you can look at the content getting sent back and forth to confirm.

    Look in the logs for other details. maybe permissions related, can the account you are running the psi extension under log on to the pwa?

    cheers Ray


    Ray Letts Arbutus Solutions
    Friday, March 11, 2011 12:30 AM
  • See Checking Errors in Project Server 2010 in the Getting Started with Development for Project 2010 article.

    For permissions, see the user on the Manage Users page in PWA.


    Jim Corbin [MSFT]

    Friday, March 11, 2011 4:26 PM
  • I have created a new Project Web App in Sharepoint with Windows Authentication and tested my service. It's working now.

    The previous Project Web App was set to use Claims Authentication.

    • Marked as answer by anate Wednesday, March 16, 2011 8:30 PM
    Wednesday, March 16, 2011 8:30 PM

All replies

  • yes you may just be getting a general sharepoint error message web page. Thus it will be of type text/html and not the text/xml the PSI is expecting. If you have fiddler you can look at the content getting sent back and forth to confirm.

    Look in the logs for other details. maybe permissions related, can the account you are running the psi extension under log on to the pwa?

    cheers Ray


    Ray Letts Arbutus Solutions
    Friday, March 11, 2011 12:30 AM
  • Thanks for the reply. Where to check the permissions and the logs? Could you please let me know. I am stuck with simple service.

    Friday, March 11, 2011 3:49 PM
  • See Checking Errors in Project Server 2010 in the Getting Started with Development for Project 2010 article.

    For permissions, see the user on the Manage Users page in PWA.


    Jim Corbin [MSFT]

    Friday, March 11, 2011 4:26 PM
  • Sorry for the long post. I appreciate any help. Here is some data from Fiddler. I don't see any errors in PSI log. I am an administrator on this machine also have permission to access PWA. I was able to access my service using IE.

    Manage Users on PWA is DomainName\administrator i:0#.w|DomainName\administrator Active 3/13/2011 9:41 PM

    I have been testing the sample code from these articles.

    http://blogs.msdn.com/b/project_programmability/archive/2010/07/06/writing-a-psi-extension-for-project-server-2010.aspx

    http://msdn.microsoft.com/en-us/library/ff843379.aspx

    Development environment is Windows server 2008(Virtual machine). I hosted PSI extension service in Sharepoint Project server. Please advice.

    Fiddler data:

    Login:

    Authorization: NTLM

    GET /_vti_bin/psi/helloservice.svc HTTP/1.1 Content-Type: text/xml; charset=utf-8

    MicrosoftSharePointTeamServices: 14.0.0.4762 Server: Microsoft-IIS/7.5 X-AspNet-Version: 2.0.50727 X-SharePointHealthScore: 4

    Here is my web.config from PSI folder.

    <system.serviceModel>
    <bindings>
    <basicHttpBinding>
    <binding name="extensionBasicHttpConf"
    closeTimeout="00:01:00"
    openTimeout="00:01:00"
    receiveTimeout="00:10:00"
    sendTimeout="00:01:00"
    allowCookies="true"
    maxBufferSize="4194304"
    maxReceivedMessageSize="500000000"
    messageEncoding="Text"
    transferMode="StreamedResponse">
    <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm="" />
    </security>
    </binding>
    <binding name="mexHttpBinding">
    <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm="" />
    </security>
    </binding>
    </basicHttpBinding>
    </bindings>
    <behaviors>
    <serviceBehaviors>
    <behavior name="PSIExtensionServiceBehavior">
    <serviceDebug includeExceptionDetailInFaults="true" />
    <serviceMetadata httpGetEnabled="true" />
    </behavior>
    </serviceBehaviors>
    </behaviors>
    <services>
    <service name="Microsoft.SDK.Project.Samples.HelloService.Hello"
    behaviorConfiguration="PSIExtensionServiceBehavior">
    <endpoint address=""
    binding="basicHttpBinding"
    bindingConfiguration="extensionBasicHttpConf"
    contract="Microsoft.SDK.Project.Samples.HelloService.IHello" />
    <endpoint address="mex"
    binding="basicHttpBinding"
    bindingConfiguration="mexHttpBinding"
    name="mex"
    contract="IMetadataExchange" />
    </service>
    <service name="Microsoft.SDK.Project.Samples.PSIExtensions.TimesheetExt"
    behaviorConfiguration="PSIExtensionServiceBehavior">
    <endpoint address=""
    binding="basicHttpBinding"
    bindingConfiguration="extensionBasicHttpConf"
    contract="Microsoft.SDK.Project.Samples.PSIExtensions.ITimesheetExt" />
    <endpoint address="mex"
    binding="basicHttpBinding"
    bindingConfiguration="mexHttpBinding"
    name="mex"
    contract="IMetadataExchange" />
    </service>
    </services>

     

     

     

     

    App.config

    App.Config
    
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
     <system.serviceModel>
     <behaviors>
      <endpointBehaviors>
      <behavior name="basicHttpBehavior">
       <clientCredentials>
       <windows allowedImpersonationLevel="Impersonation" />
       </clientCredentials>
      </behavior>
      </endpointBehaviors>
     </behaviors>
     <bindings>
      <basicHttpBinding>
      <binding name="basicHttpConf" sendTimeout="01:00:00" maxBufferSize="500000000"
       maxReceivedMessageSize="500000000">
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
       maxBytesPerRead="4096" maxNameTableCharCount="500000000" />
       <security mode="TransportCredentialOnly">
       <transport clientCredentialType="Ntlm" realm="" />
       </security>
      </binding>
      <binding name="BasicHttpBinding_IHello" closeTimeout="00:01:00"
       openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
       allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
       maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
       messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
       useDefaultWebProxy="true">
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
       maxBytesPerRead="4096" maxNameTableCharCount="16384" />
       <security mode="TransportCredentialOnly">
       <transport clientCredentialType="Ntlm" proxyCredentialType="None"
        realm="" />
       <message clientCredentialType="UserName" algorithmSuite="Default" />
       </security>
      </binding>
      </basicHttpBinding>
     </bindings>
     <client>
      <endpoint address="http://server/pwa/_vti_bin/psi/helloservice.svc"
     behaviorConfiguration="basicHttpBehavior" binding="basicHttpBinding"
     bindingConfiguration="basicHttpConf" contract="SvcHello.IHello"
     name="basicHttp_HelloService" />
     </client>
     </system.serviceModel>
    </configuration>
    

     

     

     

    Monday, March 14, 2011 1:03 AM
  • I'm getting the exact same error. The ULS shows nothing unusual; my guess this is an WCF domain-only error, with little or no connection with Project Server or SharePoint.
    Tuesday, March 15, 2011 10:29 AM
  • Here are my settings in IIS Sharepoint Web Services for Project Server.

                               ecdd9a01ab7447d5a3fde7a027f4cc02

                                             Anonymous Authentication -- Disabled , Asp.net Impersonation - Disabled, Basic Authentication- Disabled, Digest Authentication- Disabled, Forms Authentication - Disabled, Windows Authentication - Enabled.

                                For PSI -

                                                Anonymous Authentication -- Enabled and everything else disabled. 

    My user is on PWA as an Administrator(Cliams based authentication). Please advice what else could be wrong? 

    Tuesday, March 15, 2011 2:33 PM
  • Now I am getting the following error message.

    "http request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'NTLM'"

            BasicHttpBinding binding = new BasicHttpBinding();
            binding.Name = "BasicHttpBinding_IHello";
            binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
            binding.MessageEncoding = WSMessageEncoding.Text;
            binding.TransferMode = TransferMode.Buffered;
            binding.UseDefaultWebProxy = true;
            binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
            binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
            binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
          
            binding.SendTimeout = new TimeSpan(0, 10, 0);
            EndpointAddress endPointAddress = new EndpointAddress("http://servername/pwa/_vti_bin/PSI/HelloService.svc");
    
            SvcHello.HelloClient helloClient = new SvcHello.HelloClient(binding, endPointAddress);
    
            helloClient.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
    
            helloClient.ChannelFactory.Credentials.Windows.ClientCredential = new System.Net.NetworkCredential("Administrator", "password", "Domain");
            helloClient.ClientCredentials.Windows.AllowNtlm = true;
            helloClient.EchoHello();
    Tuesday, March 15, 2011 7:32 PM
  • I have created a new Project Web App in Sharepoint with Windows Authentication and tested my service. It's working now.

    The previous Project Web App was set to use Claims Authentication.

    • Marked as answer by anate Wednesday, March 16, 2011 8:30 PM
    Wednesday, March 16, 2011 8:30 PM