Problem could be reproduced for all types of Client Model Object (Managed, JS, etc..)
for example (Managed Client Model Object):
using (var context = new ClientContext("http:\\WebApplicationURL"))
{
var site = context.Web;
context.Load(site, s => s.Title);
context.ExecuteQuery();
Console.WriteLine(site.Title);
Console.ReadLine();
}
1) All works fine if cookies is turned on in web.config for Web Application ()
in "fiddler":
Request: POST /_vti_bin/client.svc/ProcessQuery HTTP/1.1
Response: HTTP/1.1 200 OK
2) If using cookieless session ()
"context.ExecuteQuery()" generate WebException "The remote server returned an error: (404) Not Found."
in "fiddler":
Request: GET /(S(1j0bsz55e3dk1455dhagx4ry))/_vti_bin/client.svc/ntlm/ProcessQuery HTTP/1.1
Response: HTTP/1.1 404 Not Found
What settings should be applied for correct working "Client Model Object" in cookieless session or "Client Model Object" couldn't be used without cookies at all?
EDIT
Some additional problems description:
with cookies context.ExecuteQuery() transform in 4 requests (all requests/response aren't contains cookies) (
- 3 calls to /_vti_bin/sites.asmx requesting the FormsDigest information, which contains the security token.
- 1 to /_vti_bin/client.svc/ProcessQuery
Request: POST WebApplication/_vti_bin/client.svc/ProcessQuery HTTP/1.1 X-RequestDigest: 0xECF432C8EB314A8C6B5ED6AB71466996B36E554AC51D445633AA8D038FCD9CB410A6965E6D0F33D6AF70F273D05510F55C1AD37089648F1EE5317A3B0F194EFE,30 Jan 2014 13:50:00 -0000 Content-Type: text/xml X-RequestForceAuthentication: true Host: WebApplication Content-Length: 612 Expect: 100-continue
Response: HTTP/1.1 200 OK Cache-Control: private Content-Type: application/json Server: Microsoft-IIS/7.5 SPRequestGuid: ea3f7a0b-2170-413a-8e42-9d2b1e56fcde X-SharePointHealthScore: 0 X-Content-Type-Options: nosniff X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET MicrosoftSharePointTeamServices: 14.0.0.7015 X-MS-InvokeApp: 1; RequireReadOnly Date: Thu, 30 Jan 2014 13:50:00 GMT Content-Length: 273
[ { "SchemaVersion":"14.0.0.0","LibraryVersion":"14.0.7010.1000","ErrorInfo":null },2,{ "IsNull":false },4,{ "IsNull":false },5,{ "ObjectType":"SP.Web","ObjectIdentity":"740c6a0b-85e2-48a0-a494-e0f1759d4aa7:web:622c751b-aedf-4185-9737-f0768a64142d","Title":"sc1718" } ]
without cookies: context.ExecuteQuery() transform in 5 requests (all requests/response aren't contains cookies)
- 3 calls the same as "with cookies"
- 2 calls to _vti_bin/client.svc/ntlm/ProcessQuery
1) Request: POST WebApplication/_vti_bin/client.svc/ProcessQuery HTTP/1.1 X-RequestDigest: 0xF71F2826979622452C5DDE5F3A1D55BC3B7EAD70E0798452D1F47A74242CC92A76F5DC84209CECE798F2F93735CCC41527714C2DE58113194962843BB065BF98,30 Jan 2014 09:44:22 -0000 Content-Type: text/xml X-RequestForceAuthentication: true Host: WebApplication Content-Length: 612 Expect: 100-continue
Response: HTTP/1.1 302 Found Content-Type: text/html; charset=utf-8 Location: /(S(zvjwtkawdkuozwfurptxk245))/_vti_bin/client.svc/ntlm/ProcessQuery Server: Microsoft-IIS/7.5 SPRequestGuid: 1229be02-6a64-4f31-bb21-fc91f1d10bd8 X-SharePointHealthScore: 1 X-Powered-By: ASP.NET MicrosoftSharePointTeamServices: 14.0.0.7015 X-MS-InvokeApp: 1; RequireReadOnly Date: Thu, 30 Jan 2014 09:44:21 GMT Content-Length: 195
Object moved
Object moved to here.
2) Request: GET WebApplication/(S(zvjwtkawdkuozwfurptxk245))/_vti_bin/client.svc/ntlm/ProcessQuery HTTP/1.1 X-RequestDigest: 0xF71F2826979622452C5DDE5F3A1D55BC3B7EAD70E0798452D1F47A74242CC92A76F5DC84209CECE798F2F93735CCC41527714C2DE58113194962843BB065BF98,30 Jan 2014 09:44:22 -0000 Content-Type: text/xml X-RequestForceAuthentication: true Host: share1:1718
Response: HTTP/1.1 404 Not Found Cache-Control: private Content-Type: text/html; charset=UTF-8 Server: Microsoft-IIS/7.5 SPRequestGuid: c1e7007a-d866-446d-add5-ea4dee2cba0e X-SharePointHealthScore: 1 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET MicrosoftSharePointTeamServices: 14.0.0.7015 X-MS-InvokeApp: 1; RequireReadOnly Date: Thu, 30 Jan 2014 09:44:21 GMT Content-Length: 1019
#content{ FONT-SIZE: 0.7em; PADDING-BOTTOM: 2em; MARGIN-LEFT: 30px}BODY{MARGIN-TOP: 0px; MARGIN-LEFT: 0px; COLOR: #000000; FONT-FAMILY: Verdana; BACKGROUND-COLOR: white}P{MARGIN-TOP: 0px; MARGIN-BOTTOM: 12px; COLOR: #000000; FONT-FAMILY: Verdana}PRE{BORDER-RIGHT: #f0f0e0 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #f0f0e0 1px solid; MARGIN-TOP: -5px; PADDING-LEFT: 5px; FONT-SIZE: 1.2em; PADDING-BOTTOM: 5px; BORDER-LEFT: #f0f0e0 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f0f0e0 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e5e5cc}.heading1{MARGIN-TOP: 0px; PADDING-LEFT: 15px; FONT-WEIGHT: normal; FONT-SIZE: 26px; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 3px; MARGIN-LEFT: -30px; WIDTH: 100%; COLOR: #ffffff; PADDING-TOP: 10px; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #003366}.intro{MARGIN-LEFT: -15px} Service Service
Endpoint not found.