title: Sharepoint 2010 http 400 error on cusom action (ribbon)
body: <p>On my production environment (win2008) I get 400 error (Request Error), "The server encountered an error processing the request. See server logs for more details". The error appears if I try to execute my custom action on document library elemeents.</p>
  
  <p>If I try get <a href="http://sharepoint.production.com:8080/" rel="nofollow">http://sharepoint.production.com:8080/</a><strong>_vti_bin/client.svc/ProcessQuery</strong> I get 400 error. But when I try GET my localhost the 405 (it is ok because I use GET not POST)</p>
  
  <p>I tried to set up FailedRequest logging but this error is not logged.</p>
  
  <p><strong>Fiddler requests and responses</strong></p>
  
  <pre><code>POST /pro%20XXX/Forms/AllItems.aspx?RootFolder=%2Fpro%20XXX%2FGarwolin&amp;FolderCTID=0x0120000187CA95D092EC41B3757A02269D8D12&amp;View={25EAB044-0F7F-4428-A493-FB0B6AC9A913} HTTP/1.1
  
  HTTP/1.1 401 Unauthorized
  Server: Microsoft-IIS/7.0
  SPRequestGuid: 7ba8dbfd-df03-4289-b97f-af3a8c01d308
  WWW-Authenticate: NTLM
  X-Powered-By: ASP.NET
  MicrosoftSharePointTeamServices: 14.0.0.4762
  Date: Thu, 28 Jul 2011 06:59:23 GMT
  Content-Length: 0
  Proxy-Support: Session-Based-Authentication
  
  
  POST /pro%20XXX/Forms/AllItems.aspx?RootFolder=%2Fpro%20XXX
  %2FGarwolin&amp;FolderCTID=0x0120000187CA95D092EC41B3757A02269D8D12&amp;View={25EAB044-0F7F-4428-A493-FB0B6AC9A913} HTTP/1.1
  HTTP/1.1 401 Unauthorized
  Content-Type: text/html; charset=us-ascii
  Server: Microsoft-HTTPAPI/2.0
  WWW-Authenticate: NTLM TlRMTVNTUAACAAAAFAAUADgAAAAFgomiS//Gvbz0rhMAAAAAAAAAAMAAwABMAAAABgByFwAAAA9FAEsATwBLAEEATABPAFIASQBBAAIAFABFAEsATwBLAEEATABPAFIASQBBAAEAEABIAFAARwBVAEUAUwBUADEABAAiAEUAawBvAGsAYQBsAG8AcgBpAGEALgBjAG8AbQAuAHAAbAADADQASABQAEcAVQBFAFMAVAAxAC4ARQBrAG8AawBhAGwAbwByAGkAYQAuAGMAbwBtAC4AcABsAAUAIgBFAGsAbwBrAGEAbABvAHIAaQBhAC4AYwBvAG0ALgBwAGwABwAIAPpMSOLzTMwBAAAAAA==
  Date: Thu, 28 Jul 2011 06:59:24 GMT
  Content-Length: 341
  Proxy-Support: Session-Based-Authentication
  
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"&gt;
  &lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;Not Authorized&lt;/TITLE&gt;
  &lt;META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"&gt;&lt;/HEAD&gt;
  &lt;BODY&gt;&lt;h2&gt;Not Authorized&lt;/h2&gt;
  &lt;hr&gt;&lt;p&gt;HTTP Error 401. The requested resource requires user authentication.&lt;/p&gt;
  &lt;/BODY&gt;&lt;/HTML&gt;
  
  
  POST /pro%20XXX/Forms/AllItems.aspx?RootFolder=%2Fpro%20XXX%2FGarwolin&amp;FolderCTID=0x0120000187CA95D092EC41B3757A02269D8D12&amp;View={25EAB044-0F7F-4428-A493-FB0B6AC9A913} HTTP/1.1
  
  HTTP/1.1 200 OK
  Cache-Control: private
  Content-Type: text/html; charset=utf-8
  Content-Encoding: gzip
  Vary: Accept-Encoding
  Server: Microsoft-IIS/7.0
  SPRequestGuid: 22795fa6-ba9b-4c58-b80f-b156b06ff331
  Set-Cookie: WSS_KeepSessionAuthenticated={288a5ad3-46ea-4f8c-b1ce-2b32472a69d1}; path=/
  X-SharePointHealthScore: 0
  Set-Cookie: WSS_KeepSessionAuthenticated={288a5ad3-46ea-4f8c-b1ce-2b32472a69d1}; path=/
  X-AspNet-Version: 2.0.50727
  Set-Cookie: http%3A%2F%2Fsharepoint%2EXXX%2Ecom%2Epl%3A8080%2FDiscovery=WorkspaceSiteName=UEtC&amp;WorkspaceSiteUrl=aHR0cDovL3NoYXJlcG9pbnQuZWtva2Fsb3JpYS5jb20ucGw6ODA4MA==&amp;WorkspaceSiteTime=MjAxMS0wNy0yOFQwNjo1OToyNA==; expires=Sat, 27-Aug-2011 06:59:24 GMT; path=/_vti_bin/Discovery.asmx
  X-Powered-By: ASP.NET
  MicrosoftSharePointTeamServices: 14.0.0.4762
  Date: Thu, 28 Jul 2011 06:59:24 GMT
  Content-Length: 34907
  
  
  POST /_layouts/inplview.aspx?List={6BA8B198-7710-4750-936B-7273027EA98C}&amp;View={25EAB044-0F7F-4428-A493-FB0B6AC9A913}&amp;ViewCount=15&amp;ListViewPageUrl=http://sharepoint.XXX.com.pl:8080/pro%2520XXX/Forms/AllItems.aspx&amp;IsXslView=TRUE&amp;Cmd=EcbView&amp;FolderCTID=0x0120000187CA95D092EC41B3757A02269D8D12 HTTP/1.1
  
  HTTP/1.1 200 OK
  Cache-Control: no-cache
  Pragma: no-cache
  Transfer-Encoding: chunked
  Content-Type: text/html; charset=utf-8
  Content-Encoding: gzip
  Expires: -1
  Vary: Accept-Encoding
  Server: Microsoft-IIS/7.0
  SPRequestGuid: c7ae7a42-ccd7-46f9-9c36-057cb9093da9
  Set-Cookie: WSS_KeepSessionAuthenticated={288a5ad3-46ea-4f8c-b1ce-2b32472a69d1}; path=/
  X-SharePointHealthScore: 0
  X-AspNet-Version: 2.0.50727
  X-Powered-By: ASP.NET
  MicrosoftSharePointTeamServices: 14.0.0.4762
  Date: Thu, 28 Jul 2011 06:59:27 GMT
  
  113c
  
  
  POST /_vti_bin/client.svc/ProcessQuery HTTP/1.1
  
  HTTP/1.1 400 Bad Request
  Cache-Control: private
  Content-Type: text/html
  Server: Microsoft-IIS/7.0
  SPRequestGuid: 6eddd041-2427-42f6-b69c-1c6ac1d3abd1
  Set-Cookie: WSS_KeepSessionAuthenticated={288a5ad3-46ea-4f8c-b1ce-2b32472a69d1}; path=/
  X-SharePointHealthScore: 0
  X-AspNet-Version: 2.0.50727
  X-Powered-By: ASP.NET
  MicrosoftSharePointTeamServices: 14.0.0.4762
  Date: Thu, 28 Jul 2011 06:59:29 GMT
  Content-Length: 1165
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;HTML&gt;&lt;HEAD&gt;&lt;STYLE type="text/css"&gt;#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}&lt;/STYLE&gt;
  &lt;TITLE&gt;Request Error&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;
  &lt;DIV id="content"&gt;
  &lt;P class="heading1"&gt;Request Error&lt;/P&gt;
  &lt;BR/&gt;
  &lt;P class="intro"&gt;The server encountered an error processing the request. See server logs for more details.&lt;/P&gt;
  &lt;P class="intro"&gt;&lt;/P&gt;
  &lt;/DIV&gt;
  &lt;/BODY&gt;&lt;/HTML&gt;
  </code></pre>
  
  <p>And xml request from custom action</p>
  
  <pre><code>&lt;Request xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009" SchemaVersion="14.0.0.0" LibraryVersion="14.0.4762.1000" ApplicationName="Javascript Library"&gt;
  &lt;Actions&gt;
  &lt;ObjectPath Id="1" ObjectPathId="0"&gt;&lt;/ObjectPath&gt;
  &lt;ObjectPath Id="3" ObjectPathId="2"&gt;&lt;/ObjectPath&gt;
  &lt;ObjectPath Id="5" ObjectPathId="4"&gt;&lt;/ObjectPath&gt;
  &lt;Query Id="6" ObjectPathId="2"&gt;
  &lt;Query SelectAllProperties="true"&gt;
  &lt;Properties&gt;&lt;/Properties&gt;
  &lt;/Query&gt;
  &lt;/Query&gt;
  &lt;Query Id="7" ObjectPathId="4"&gt;
  &lt;Query SelectAllProperties="true"&gt;
  &lt;Properties&gt;&lt;/Properties&gt;
  &lt;/Query&gt;
  &lt;/Query&gt;
  &lt;/Actions&gt;
  &lt;ObjectPaths&gt;
  &lt;StaticProperty Id="0" TypeId="{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}" Name="Current"&gt;&lt;/StaticProperty&gt;
  &lt;Property Id="2" ParentId="0" Name="Site"&gt;&lt;/Property&gt;
  &lt;Property Id="4" ParentId="0" Name="Web"&gt;&lt;/Property&gt;
  &lt;/ObjectPaths&gt;
  &lt;/Request&gt;
  </code></pre>