Can IT Hit WebDAV Lib be used with ASP.NET Web API 2 in the same Project?

240 views Asked by At

I´m currently evaluating Web Dav Product for .NET and I´m really impressed. I only noticed that when I´m integrating the sample code (Asp.NetFileSystem) into my existing ASP.NET Web API 2 Project, it doesn´t work with Office Word directly as a save target. We have Web API 2 with Windows Authentication and CORS Headers on. Windows Explorer can open and Navigate the WebDAV Folder and I can create new files there. But when I´m saving from word directly, I get errors in Word that the network path does not work / exist. I tried to debug it but it happens I separated the WebDAV part in it´s own project for test purposes and it works without the problems.

Am I using it wrong in the context of Web API 2, or is this an unsupported usecase?

I´ll try to get fiddler logs to.

Thanks a lot!

1

There are 1 answers

0
Florian Wachs On BEST ANSWER

Thanks to the IT Hit WebDav we were able to trace the problem down. To work correctly, OPTION requests have to be processed by the WebDAVHandler. We have a custom module which intercepts OPTION requests to handle CORS. Because of our Module, the WebDAVHandler was not able to add the necessary headers, and Office opened the files readonly.