Building an Office Web Apps (OWA) WOPI Host

This solution gives you a simple WOPI Host that provides viewing, and editing through Office Web Apps via a custom WOPI Server. Illustrates the implementation of WOPI for a Server in a working example.

C# (2.7 MB)
 
 
 
 
 
4.8 Star
(14)
7,828 times
Add to favorites
10/15/2015
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Editing online
    1 Posts | Last post November 08, 2017
    • I have successfully able to view the document but after edit it will not hit the Route("files/{name}/contents") post method. anything that missed? 
  • Can't load this document
    1 Posts | Last post October 30, 2017
    • In vs2017, I open "http://localhost:32876/ ". then I click the button("Get Link"). I got Result URL.
      After I clicked this URL,something went wrong.
      -----------------------------------
      Microsoft Word Online
      Something went wrong and we couldn't load this content. Refreshing the browser may fix the problem
      -----------------------------------
      I checked that test.docx is in "App_Data" document. I can open it in Microsoft Word.but it didn't work well in Microsoft Word Online.
      Please help me.
  • Is it work for AWS s3 as a file source
    2 Posts | Last post October 19, 2017
    • Hi Shawn. This is a very useful example.thanks for making this.
      
      Is this work if the file source is AWS s3?
    • you need coding for get/store file for AWS
  • Editing Issues
    1 Posts | Last post October 18, 2017
    • 1.Excel/PPT can open with editing mode, save funtion will throw error but file save successful actually.
      2.Word can not open with editing mode.
      
      could help to check for me
  • about .xls file and .doc file can't preview
    3 Posts | Last post March 09, 2017
    • hi,
      how can I preview the .doc,.xls.. file ?
      when I was in URL (http://192.168.1.251/WopiHost/api/Link/GetLink? Name=1.docx&access_token=undefined) in the test.xlsx into test.xls will be wrong .
      could you tell me how to change it? 
      think you  
    • sorry,URL (http://192.168.1.251/WopiHost/api/Link/GetLink? Name=test.xlsx&access_token=undefined) 
    • http://192.168.1.251/x/_layouts/xlviewerinternal.aspx?WOPISrc=http%3a%2f%2f192.168.1.251%2fWopiHost%2fapi%2fwopi%2fFiles%2ftest.xls&access_token=%2f2dSaTRR1ns%3dLmXszl0P%2fgmjL0mRhmxtJg9XCYEPpJuUkKjUNR31HA0%3d
      this is the url ,but it   returned application error 
  • Need help in writing WOPI host
    1 Posts | Last post December 07, 2016
    • hi,
      
      I am doing a POC for viewing documents which are stored on azure blob. So in my poc:
      
      1. WOPI host is the piece I am writing that will download files from blob and call WOPI client.
      2. WOPI client would be Office Online server (successor to Office Web Apps Server).
      
      For POC purpose I am referring https://view.officeapps.live.com/hosting/discovery as WopiDiscovery url. But it's not calling my checkFileInfo implementation. Any idea why happening so ?
      
      
  • Is there indispensable to create WOPI Host when i cant call direct to OWA
    1 Posts | Last post December 07, 2016
    • Hi Shawn Cicoria,
      
      I'm new in OWA and Sharepoint
      When I study about OWA, I see can binnding direct to sharepoint, and make request to OWA service throught WOPI protocol to get link to view/edit file in sharepoint
      So I wonder wheather there is need to create my own WOPI Host not, if so, the benefits of this creation is what?
      
      Thank you,
      
  • Files location
    2 Posts | Last post May 17, 2016
    • Hello,
      
      Is it possible to store the files somewhere else and only use OWA Server for viewing, editing purposes?
    • That's exactly what OWA Server is for.
      But you need to have a Wopi server which could access stored files (with read and write permissions).
  • Editing word gives error
    1 Posts | Last post April 28, 2016
    • I am able to setup this sample in my environment (everything onpremise). I am able to edit the pptx and xlsx files but the word/.docx gives error as mentioned by others. Error message is "Sorry, this document can't be opened for editing".
      
      As pointed by Shawn, I looked into the sample in Github.com which is more difficult to setup as it has a HttpHandlers only. But I could see in the code that if there is a POST request with header "X-WOPI-Override" ="COBALT", it returns unsupported.
      
      In the sample code given in this post, I added a new POST handler as follows and could see that its getting hit with a header "X-WOPI-Override" ="COBALT" but no idea how to deal with it. Sample in the Github also not handling it.
      In FilesController.cs
      [Route("files/{name}/")]
              public string PostLock()
              {
                  //Put a break point here and could see Request.Headers["X-WOPI-Override"] in the header and its "Cobalt"
                  return "dummy";
              }
      
      Can somebody point to a complete sample where I can edit all the office files using OWA?
      Thanks in advance
      Joy
  • What should be the Value of appWopiServer ?
    1 Posts | Last post March 14, 2016
    • Hi Shawn,
      
      First of all thanks for a good article for usage of WOPI. I went through it and most of the things are self explanatory.I have configured it against our own webapps server and downloaded the discovery.xml from the local installation. It generates a local url for us now.
      
      However, the value of appWopiServer still remains in question. What should go there ? 
      
      I hosted your application on IIS with Anonymous access and put the files in a files folder specifically created to test application. So when I test this hosted application and type in the url http://mymachinename/files/test.docx, it downloads the file on my system even when trying from remote machine. So after this I replaced the appWopiServer = "http://mymachinename/files/" instead of your url in the web.config. 
      
      The url generated gives me a "Server Error" when trying to open it. Am I missing anything here ? 
      
      Eg for genrated url is : http://mywebappserver/we/wordeditorframe.aspx?WOPISrc=http%3a%2f%2fmymachinename%2ffiles%2ftest.docx&access_token=77234j%3d4k24972734324j32g32gt447423jh3224234jg2347%3d
      
      
      Regards,
      Kushagra 
1 - 10 of 49 Items