none
Office online integration with PHP RRS feed

  • Question

  • Hello Support,

    We are trying to integrate Microsoft office online with PHP web application but we are not getting any sample PHP WOPI HOST. We have already installed Office web apps server and have discovery URL, But we are not getting how to create WOPI host and integrate it with Office Web Apps server. We have already read WOPI documentation but not able to get how to create and integrate it with our Application. Could you please help us in this matter and let us know how to create a WOPI host in PHP.

    Looking forward.

    Thanks in Advance

    Tuesday, December 18, 2018 2:03 PM

All replies

  • Hi Gurpreet, 

    If you are integrating with Office Web Apps Server 2013 or Office Online Server 2016, then we can assist you with this question. If you are integrating with Office Online (Office365 cloud product), please direct your question to the Yammer discussion group for the Cloud Storage Partner Program. You can find information on CSPP here:

    https://social.msdn.microsoft.com/Forums/en-US/8ed5b708-9edf-4839-a13f-e93e59396ff1/wopi-host-implementers-please-read?forum=os_office

    Either way, there is sample code for WOPI Host implementers that can be very helpful. It is provided to accompany the online documentation for integration: 

    https://wopi.readthedocs.io/en/latest/

    https://wopi.readthedocs.io/en/latest/hostpage.html#host-page-example

    https://github.com/Microsoft/Office-Online-Test-Tools-and-Documentation/blob/master/samples/SampleHostPage.html

    There is also a sample using C# and MVC that might be helpful to you: 

    https://github.com/InteropEvents/WOPISolution

    After reviewing these, if you have a specific question about the WOPI protocol, please post it on this forum and reference the [MS-WOPI] section you are having trouble with and we will assist you.


    Best regards,
    Tom Jebo
    Sr Escalation Engineer
    Microsoft Open Specifications

    Tuesday, December 18, 2018 4:55 PM
    Moderator
  • Hello Tom,

    Thanks for your reply.

    We are using web apps server 2013 on premises and also created a PHP Wopi host. We can view the Docx file properly in the viewer but we are not able to edit it. When we try to open Docx file in the editor it says "Sorry, you don't have permission to edit this document". We have only tested it with Docx files as of now. We have only created CheckFileInfo, GetFile, PutFile REST Endpoints. We don't want to support file locking while editing. 

    Could you please review and let us know what is wrong with the implementation? and help us to get rid of this permission error.

    Thanks,
    Gurpreet Rajpal

    Wednesday, December 19, 2018 1:44 PM
  • Hi Gurpreet, 

    Office Web Apps Server 2013 requires FSSHTTP support to provide Word document editing. If you have implemented: 

    [MS-FSSHTTP]: File Synchronization via SOAP over HTTP Protocol
    https://msdn.microsoft.com/en-us/library/dd943623(v=office.12).aspx

    in your WOPI host server, then you can set the WOPI CheckFileInfo response variable "SupportsCobalt" to let Office Web Apps Server know and editing will be attempted. 

    Office Online Server 2016 does not have this additional requirement and editing Word documents can be accomplished without implementing FSSHTTP.

    Best regards,
    Tom Jebo
    Sr Escalation Engineer
    Microsoft Open Specifications


    Wednesday, December 19, 2018 8:48 PM
    Moderator
  • Hello Tom,

    We are also getting one more error while trying to edit any document "Sorry, you don't have permission to edit this document". Do you have any idea why we are getting this message? 

    Thanks in advance

    Thursday, December 20, 2018 10:41 AM
  • Hi Gurpreet, 

    This could be any number of reasons. Have you already debugged the host code to see if the problem is simple access to the underlying file? 

    Another possibility is that you have not set the CheckFileInfo response properties for that specific file to allow editing (i.e. UserCanEdit). 

    After checking out the above mentioned possibilities, if you still need help in analyzing this, I will need to see a fiddler trace that includes the WOPI protocol request/responses and the ULS logs (I can give you instructions) to match. To take this route, please send an email to dochelp@microsoft.com, referencing the URL for this forum thread and my name. I will guide you in gathering these data and assist in troubleshooting.

    Tom

    Thursday, December 20, 2018 5:33 PM
    Moderator
  • Hello Tom,

    Hope you are doing great!

    I have created WOPI HOST successfully and it is working fine but I am having a problem while editing any document in office online editor. I need to update the viewer and generate a PDF from DOCX as soon as the user closes the editor Modal window but I am not getting updated Docx file even after waiting for 5 - 6 seconds before generating PDF. 

    Can we hit PUTFILE operation before closing the office online editor Modal? Or is there any other way to fix this issue?

    Can you please help me to sort out this?

    I will really appreciate your help.

    Thanks,
    Gurpreet

    Wednesday, January 2, 2019 12:29 PM
  • Hello Gurpreet,

    Thank you for your question. One of our protocols engineers will respond soon. 

    Thanks,


    Jeff McCashland | Microsoft Protocols Open Specifications Team

    Wednesday, January 2, 2019 4:26 PM
    Moderator
  • Hi Gurpreet,

    Likely the problem is that the host's web app is not navigating away from the Office Online page. Office web app detects this and provides the final PutFile to update the document. Usually, the host's page is navigated to a new host page.

    You can't actually force the PutFile from the host code but it shouldn't be necessary if you properly navigate after the edit session.

    Usually this means navigating to the viewer or to another page.

    The following describes the putfile behavior of Office Online for Word: 

    https://wopi.readthedocs.io/en/latest/scenarios/coauth.html?highlight=putfile%20update#word-online-co-authoring-behavior 

    Another possible reason is related to the file version that needs to be updated and that is described here: 

    https://wopi.readthedocs.io/en/latest/build_test_ship/common_issues.html#after-editing-a-document-in-wac-opening-the-same-document-in-view-mode-doesn-t-contain-the-changes

    Hope this helps,

    Tom


    Wednesday, January 2, 2019 4:53 PM
    Moderator
  • If you still need assistance, please send an email to dochelp at microsoft.com referencing the URL for this (or the other) thread and my name. I will likely need to make arrangements to gather data from you.

    Thanks,

    Tom

    Monday, January 7, 2019 6:16 PM
    Moderator