Hi David,
Actually "
http://davidwindward.workspace.office.live.com/Docs/DavidT -
simple test.xlsx" *IS* the *REAL* url of the document.
Let me explain more about what I found.
When you copy & paste this address:
http://workspace.office.live.com/#davidwindward/Documents/DavidT - simple
test.xlsx
into a browser, you got the file show up in the browser. Yes, that's right
- because you have your Windows Live ID already logged in. Now the server
got the request from the browser, it first checks the Live ID login, if
that's okay, it will parse the requested URL into the *REAL* path and
redirect the browser.
To prove this, what if you sign out of your Live ID from the browser and
clear all the stored browser cookies, then paste the URL into the browser
again and see if the file can be opened again?
But simply sending an HTTP request to the server with the *REAL* url still
won't work. The Office Live Add-in actually sends several requests to the
Office Live server to login, get meta information about the document, and
finally request for the document itself.
Here is a portion of what the Office Live Add-in sent to the server
requesting for the "document2.docx" file in my workspace:
*** begin request header ***
HEAD /Docs/Document2.docx HTTP/1.1
User-Agent: Microsoft Office Existence Discovery
Host: jiewan.workspace.office.live.com
Content-Length: 0
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: <too long, omitted>
*** end request header***
Note in the first line, it actually requests "/Docs/Document2.docx", that
matches the value Word returns.
Also note the User-Agent is "Microsoft Office Existence Discovery", if you
make a request with a different value, you get a "501- Not Implemented."
HTTP error. This is what exactly we see if we paste the *REAL* url into the
browser and hit enter - because our browser's User-Agent value if different.
Documents on the Office Live server are not simply put there, they may not
be files on the server at all, they may be stored in database, and upon
correct requests to the server application, the file stream is then sent to
the client.
I think it is possible to do the same thing the Office Live Add-in does, to
get the file from the server, however, it is inappropriate for me to do the
reverse engineering like job and publish the result to the public. I hope
you can understand this.
All I can tell you is, I used a tool called Fiddler to analyze the HTTP
data flow between the Word and the Office Live server, and got a basic
understanding of how the Add-in works. You can get the free tool from its
official website (3rd party website, not owned or controlled by MSFT, use
at your own risk):
http://www.fiddler2.com/fiddler2/.
Best regards,
Jie Wang
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.