MOSSPOINT
asked on
DELETE not working with web.config configuration
Hi,
I have a asp.net MVC4 web api application with sqlsvr 2008 database and a sencha application accessing it. The application accesses the data OK with the GET command but the DELETE is rejected by the server with a not very useful message "DELETE http://1st-tip.com/api/user/1?_dc=1358176005164 500 (Internal Server Error) sencha-touch-all.js:21"
I've included the web.config as follows, can anybody tell me what I've not configured correctly to deny the access to the DELETE command?
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.I nternal.Co nfigFile.E ntityFrame workSectio n, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c56193 4e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="DefaultConnection" providerName="System.Data. SqlClient" connectionString="Data Source=.\SQLEXPRESS;Initia l Catalog=aspnet-TestSenchaM VC1-201301 04121322;I ntegrated Security=SSPI" />
<add name="DB_4986_senchatestEn tities" connectionString="metadata =res://*/M odel.csdl| res://*/Mo del.ssdl|r es://*/Mod el.msl;pro vider=Syst em.Data.Sq lClient;pr ovider connection string="data source=s09.winhost.com;ini tial catalog=DB_4986_senchatest ;persist security info=True;user id=DB_4986_senchatest_user ;password= password;m ultipleact iveresults ets=True;A pp=EntityF ramework&q uot;" providerName="System.Data. EntityClie nt" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabl ed" value="true" />
<add key="UnobtrusiveJavaScript Enabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Enti ty, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c56193 4e089" />
</assemblies>
</compilation>
<authentication mode="None" />
<pages>
<namespaces>
<add namespace="System.Web.Help ers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc. Ajax" />
<add namespace="System.Web.Mvc. Html" />
<add namespace="System.Web.Opti mization" />
<add namespace="System.Web.Rout ing" />
<add namespace="System.Web.WebP ages" />
</namespaces>
</pages>
<!-- <profile defaultProvider="DefaultPr ofileProvi der">
<providers>
<add name="DefaultProfileProvid er" type="System.Web.Providers .DefaultPr ofileProvi der, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35" connectionStringName="Defa ultConnect ion" applicationName="/" />
</providers>
</profile>
<membership defaultProvider="DefaultMe mbershipPr ovider">
<providers>
<add name="DefaultMembershipPro vider" type="System.Web.Providers .DefaultMe mbershipPr ovider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35" connectionStringName="Defa ultConnect ion" enablePasswordRetrieval="f alse" enablePasswordReset="true" requiresQuestionAndAnswer= "false" requiresUniqueEmail="false " maxInvalidPasswordAttempts ="5" minRequiredPasswordLength= "6" minRequiredNonalphanumeric Characters ="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<roleManager defaultProvider="DefaultRo leProvider ">
<providers>
<add name="DefaultRoleProvider" type="System.Web.Providers .DefaultRo leProvider , System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35" connectionStringName="Defa ultConnect ion" applicationName="/" />
</providers>
</roleManager>
<sessionState mode="InProc" customProvider="DefaultSes sionProvid er">
<providers>
<add name="DefaultSessionProvid er" type="System.Web.Providers .DefaultSe ssionState Provider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3 64e35" connectionStringName="Defa ultConnect ion" />
</providers>
</sessionState> -->
<trust level="Full" />
</system.web>
<system.webServer>
<validation validateIntegratedModeConf iguration= "false" />
<modules runAllManagedModulesForAll Requests=" true" />
<handlers>
<remove name="ExtensionlessUrlHand ler-ISAPI- 4.0_32bit" />
<remove name="ExtensionlessUrlHand ler-ISAPI- 4.0_64bit" />
<remove name="ExtensionlessUrlHand ler-Integr ated-4.0" />
<add name="ExtensionlessUrlHand ler-ISAPI- 4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG, PUT,DELETE ,PATCH,OPT IONS" modules="IsapiModule" scriptProcessor="%windir%\ Microsoft. NET\Framew ork\v4.0.3 0319\aspne t_isapi.dl l" preCondition="classicMode, runtimeVer sionv4.0,b itness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHand ler-ISAPI- 4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG, PUT,DELETE ,PATCH,OPT IONS" modules="IsapiModule" scriptProcessor="%windir%\ Microsoft. NET\Framew ork64\v4.0 .30319\asp net_isapi. dll" preCondition="classicMode, runtimeVer sionv4.0,b itness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHand ler-Integr ated-4.0" path="*." verb="GET,HEAD,POST,DEBUG, PUT,DELETE ,PATCH,OPT IONS" type="System.Web.Handlers. TransferRe questHandl er" preCondition="integratedMo de,runtime Versionv4. 0" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microso ft-com:asm .v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad 364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0. 0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad 364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0. 0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad 364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0. 0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.I nfrastruct ure.SqlCon nectionFac tory, EntityFramework" />
</entityFramework>
</configuration>
I have a asp.net MVC4 web api application with sqlsvr 2008 database and a sencha application accessing it. The application accesses the data OK with the GET command but the DELETE is rejected by the server with a not very useful message "DELETE http://1st-tip.com/api/user/1?_dc=1358176005164 500 (Internal Server Error) sencha-touch-all.js:21"
I've included the web.config as follows, can anybody tell me what I've not configured correctly to deny the access to the DELETE command?
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.I
</configSections>
<connectionStrings>
<add name="DefaultConnection" providerName="System.Data.
<add name="DB_4986_senchatestEn
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabl
<add key="UnobtrusiveJavaScript
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Enti
</assemblies>
</compilation>
<authentication mode="None" />
<pages>
<namespaces>
<add namespace="System.Web.Help
<add namespace="System.Web.Mvc"
<add namespace="System.Web.Mvc.
<add namespace="System.Web.Mvc.
<add namespace="System.Web.Opti
<add namespace="System.Web.Rout
<add namespace="System.Web.WebP
</namespaces>
</pages>
<!-- <profile defaultProvider="DefaultPr
<providers>
<add name="DefaultProfileProvid
</providers>
</profile>
<membership defaultProvider="DefaultMe
<providers>
<add name="DefaultMembershipPro
</providers>
</membership>
<roleManager defaultProvider="DefaultRo
<providers>
<add name="DefaultRoleProvider"
</providers>
</roleManager>
<sessionState mode="InProc" customProvider="DefaultSes
<providers>
<add name="DefaultSessionProvid
</providers>
</sessionState> -->
<trust level="Full" />
</system.web>
<system.webServer>
<validation validateIntegratedModeConf
<modules runAllManagedModulesForAll
<handlers>
<remove name="ExtensionlessUrlHand
<remove name="ExtensionlessUrlHand
<remove name="ExtensionlessUrlHand
<add name="ExtensionlessUrlHand
<add name="ExtensionlessUrlHand
<add name="ExtensionlessUrlHand
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microso
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad
<bindingRedirect oldVersion="1.0.0.0-2.0.0.
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad
<bindingRedirect oldVersion="1.0.0.0-4.0.0.
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages"
<bindingRedirect oldVersion="1.0.0.0-2.0.0.
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.I
</entityFramework>
</configuration>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your reply but I think my servers configuration for IIS7.5
ExtensionlessUrlHandler-In
ExtensionlessUrlHandler-IS
ExtensionlessUrlHandler-IS
And they all have the verbs GET,HEAD,POST,DEBUG,PUT,DE
Any other ideas?