none
Error: The content type of the response message does not match the content type of the binding RRS feed

  • Question

  • Hi All,

    i'm trying to create new project using PSI code from SharePoint Workflow. but i got this error:

    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). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns:o="urn:schemas-microsoft-com:office:office" lang="en-us" dir="ltr">
    <head><meta name="GENERATOR" content="Microsoft SharePoint" /><meta name="progid" content="SharePoint.WebPartPage.Document" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Expires" content="0" /><meta name="ROBOTS" content="NOHTMLINDEX" /><title>
     
     Error

    </title><link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/Themable/corev4.css?rev=iIikGkMuXBs8CWzKDAyjsQ%3D%3D"/>
    <script type="text/javascript">
    // <![CDATA[
    document.write('<script type="text/javascript" src="/_layouts/1033/init.js?rev=BJDmyeIV5jS04CPkRq4Ldg%3D%3D"></' + 'script>');
    document.write('<script type="text/javascript" src="/ScriptResource.axd?d=VyXprhCFjAngCCeXC3LBaWgBTuTHjDeBQa3ORLWpGz5P6KSfi9qny5PhNm_220ORMjnqZ91kVjX58_bY8oXmuWnjLWyn7i3F6O7xcvDED_g1&amp;t=ffffffffec2d9970"></' + 'script>');'.

    when i call this code:

    project.QueueCreateProject(jobGuid, dsProject, false);

    i'm using Project Server Webservices:

    http://xxx/pwa/_vti_bin/psi/Project.asmx
    http://xxx/pwa/_vti_bin/psi/queuesystem.asmx

    also, i'm binding the service reference in the code

    internal static PSIWrapperServRef.ProjectSoapClient CreateWebServiceInstance()
            {
                BasicHttpBinding binding = new BasicHttpBinding();
                // I think most (or all) of these are defaults--I just copied them from app.config: 
                binding.SendTimeout = TimeSpan.FromMinutes(10);
                binding.OpenTimeout = TimeSpan.FromMinutes(10);
                binding.CloseTimeout = TimeSpan.FromMinutes(10);
                binding.ReceiveTimeout = TimeSpan.FromMinutes(10);
                binding.AllowCookies = false;
                binding.BypassProxyOnLocal = false;
                binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
                  binding.MessageEncoding = WSMessageEncoding.Text;
                binding.TextEncoding = System.Text.Encoding.UTF8;
                binding.TransferMode = TransferMode.Buffered;
                binding.UseDefaultWebProxy = true;
                binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
                binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
                return new PSIWrapperServRef.ProjectSoapClient(binding, new EndpointAddress("http://xxx/pwa/_vti_bin/psi/Project.asmx"));
            }

    i increased message buffer size, sendtimeout but still the same error

    Any advice ...

    Thanks,


    Regards, Mohamed
    Wednesday, November 10, 2010 2:11 PM

All replies