Silverlight problem calling PUT/DELETE methodshttp://forums.asp.net/t/1792599.aspx/1?Silverlight+problem+calling+PUT+DELETE+methodsFri, 13 Apr 2012 13:39:46 -040017925994931232http://forums.asp.net/p/1792599/4931232.aspx/1?Silverlight+problem+calling+PUT+DELETE+methodsSilverlight problem calling PUT/DELETE methods <p>Hello everyone!</p> <p>I'm having trouble calling PUT and DELETE methods using Silverlight 5. I tried calling the resource with DELETE using another Client, and it worked. This also worked before with the WCF Web API, but it does not anymore with ASP.NET WebAPI.</p> <p>I'm using the Client Stack which does support DELETE and PUT requests (http://msdn.microsoft.com/en-us/library/dd920295%28v=vs.95%29.aspx), and also I have a clientaccesspolicy.xml in my root folder.</p> <p>The content of the clientaccesspoliy.xml is as followed:</p> <pre class="prettyprint">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;access-policy&gt; &lt;cross-domain-access&gt; &lt;policy&gt; &lt;allow-from http-request-headers=&quot;*&quot;&gt; &lt;domain uri=&quot;https://*&quot;/&gt; &lt;domain uri=&quot;http://*&quot;/&gt; &lt;/allow-from&gt; &lt;grant-to&gt; &lt;resource path=&quot;/&quot; include-subpaths=&quot;true&quot;/&gt; &lt;/grant-to&gt; &lt;/policy&gt; &lt;/cross-domain-access&gt; &lt;/access-policy&gt;</pre> <p>I also added this to my RegisterRoutes method, to make the file accessible:</p> <pre style="font-family: Consolas; font-size: 13px; color: black; background: none repeat scroll 0% 0% white;">routes.IgnoreRoute(<span style="color: #a31515;">"clientaccesspolicy.xml"</span>); </pre> <p></p> <p>Every time I try to make a call I immediately get a SecurityException. The call does not even reach ASP.NET (Application_BeginRequest is not triggered).</p> <p>Any one knows how to solve this issue?<br> <br> </p> <p></p> <p></p> 2012-04-13T13:28:24-04:004931238http://forums.asp.net/p/1792599/4931238.aspx/1?Re+Silverlight+problem+calling+PUT+DELETE+methodsRe: Silverlight problem calling PUT/DELETE methods <p></p> <blockquote><span class="icon-blockquote"></span> <h4>MartinJ.</h4> <span class="tag">&lt;allow-from</span><span class="pln"> </span><span class="atn">http-request-headers</span><span class="pun">=</span><span class="atv">&quot;*&quot;</span><span class="tag">&gt;</span><span class="pln">&nbsp; </span></blockquote> <p></p> <p>Modify this line like this</p> <p>&lt;allow-from http-request-headers=&quot;*&quot; http-methods=&quot;*&quot;&gt;</p> 2012-04-13T13:33:19-04:004931255http://forums.asp.net/p/1792599/4931255.aspx/1?Re+Silverlight+problem+calling+PUT+DELETE+methodsRe: Silverlight problem calling PUT/DELETE methods <p>Good point, but no luck. This changes nothing. :(</p> <p>edit: Whoops, I accidently modified the wrong file. It works, thank you very much. :) Do you perhaps have any explanation why this worked before?</p> 2012-04-13T13:39:46-04:00