Regarding WOPI Integration

Microsoft

Hi Team,

 

I am trying to integrate with WOPI. I am using Discovery URL (https://ffc-onenote.officeapps.live.com/hosting/discovery) after submitting form I am getting error "Service Unavailable". Kindly help me to solve this issue.

 

Form:

<form id="office_form" name="office_form" target="office_frame" action='https://FFC-excel.officeapps.live.com/x/_layouts/xlviewerinternal.aspx?ui=1033&amp;rs=1033&amp;dchat...https://dcxcustomapppreprod.azurewebsites.net/wopi/files?id=d215d6f0-5c6e-4a31-a4fd-ff2335de64e6' method="post">
<input name="access_token" value='eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJ1bmlxdWVfbmFtZSI6InYtYWt0eWFAbWljcm9zb2Z0LmNvbSIsImNvbnRhaW5lciI6InYtYWt0eWEtbWljcm9zb2Z0LWNvbSIsImRvY2lkIjoiZDIxNWQ2ZjAtNWM2ZS00YTMxLWE0ZmQtZmYyMzM1ZGU2NGU2IiwiaXNzIjoiaHR0cHM6Ly9vZmZpY2V3b3BpLmF6dXJld2Vic2l0ZXMubmV0IiwiYXVkIjoiaHR0cHM6Ly9vZmZpY2V3b3BpLmF6dXJld2Vic2l0ZXMubmV0IiwiZXhwIjox.' type="hidden" />
<input name="access_token_ttl" value='1562751395000' type="hidden" />
</form>

<span id="frameholder"></span>

 

 

2 Replies
I'm having the same problem here. More details about the errors are needed to give a clue, since it's not possible to debug if the wopi host app can only be run on the authorized testing server by MS. I've been tens of hours searching for hints, our development is stuck.

Hi @Akhil_Tyagi 

 

Right after my previous post I just saw that you have some variables not replaced from the discovery XML. Probably your example code is old enough to not to include changes after Dec 2018. 

See that in your action attribute some values were already replaced (like <ui=UI_LLCC&> was replaced for ui=1033&; or <dchat=DISABLE_CHAT&> for dchat=false&;

You have to manage also these:

hid=HOST_SESSION_ID&

sc=SESSION_CONTEXT

wopisrc=WOPI_SOURCE&

actnavid=ACTIVITY_NAVIGATION_ID&

WOPIsrc=

 

WOPIsrc is probably added manually by your code since it was like that before, but now it is also included as a value in the action attribute as you see the (lowercase) 

wopisrc=WOPI_SOURCE

 

To read more how to manage this action attribute of the form element, please go to:

 

https://wopi.readthedocs.io/en/latest/discovery.html#action-urls

 

Hope this helps.