Error: (405) Method Not Allowed when deleting a store using the rest client from visual studio

Oct 15, 2014 at 12:07 PM
I have Brightstar 1.7.1 hosted in IIS and would like to know what I need to do in a visual studio project that would allow the following to work:

IBrightstarService client = BrightstarService.GetRestClient(restEndpoint);
var sid = Guid.NewGuid().ToString();
client.CreateStore(sid);
client.DeleteStore(sid);

It currently throws the following exception when the DeleteStore method is called:
"The remote server returned an error: (405) Method Not Allowed."

Do I need to configure some permission on the client? If so how. Or is it set when the store is created?

The web.config on the IIS hosted service contains:
<brightstarService connectionString="Type=embedded;StoresDirectory=C:\BrightstarDB\Data\">
<storePermissions>
  <fallback authenticated="All" anonymous="All"/>
</storePermissions>
<systemPermissions>
  <fallback authenticated="All" anonymous="All"/>
</systemPermissions>

<authenticationProviders>
    <add type="BrightstarDB.Server.Modules.Authentication.NullAuthenticationProvider, BrightstarDB.Server.Modules"/> *
</authenticationProviders>
</brightstarService>

which would appear to let anything happen. Any help would be appreciated,
Coordinator
Oct 15, 2014 at 2:41 PM
Hi,

Sounds like an IIS configuration issue. The B* REST client issues an HTTP DELETE request to delete a store and it appears that IIS doesn't like that. It looks like it might be related to WebDAV or just an issue with needing to have the DELETE verb enabled in IIS:

http://stackoverflow.com/questions/6147181/405-method-not-allowed-in-iis7-5-for-put-method
http://support2.microsoft.com/kb/942051

If you can let me know if either of these fix the issue for me I can add it to the docs.

Cheers

Kal
Oct 15, 2014 at 3:57 PM
Hi Kal,

On you advice the delete now works. My updated web.config looks like this:

<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
<validation validateIntegratedModeConfiguration="false"/><httpErrors existingResponse="PassThrough"/>
<handlers>
  <add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*"/>
  <remove name="WebDAV" />
</handlers>
</system.webServer>

Thank you so much for your help.

Roger
Marked as answer by techquila on 10/21/2014 at 5:21 AM
Coordinator
Oct 21, 2014 at 12:21 PM
Thanks for the update. I'll make sure that we add something into the docs about this as I'm sure other people will hit it too.