Accessing WebServices from a web app hosted inside Outlook XP

J

Jay B

Ok, it turns out that "outlook:" moniker is actually
causing our problem.

When you first load a page into Outlook XP, the
document.URL value is the same as in the Outlook address
bar, for example: "outlook:My Test App".

This is the code from webservice.htc that sees the problem:

function ensureWsdlUrl(szService)
{
if (szService.indexOf("://") > 0)
return szService;
var baseUrl = element.document.URL;
var qi = baseUrl.lastIndexOf("?");
var url2 = qi > 0 ? baseUrl.substr(0, qi) : baseUrl;
return url2.substr(0, baseUrl.lastIndexOf("/"))
+ "/" + szService + (szService.indexOf(".")
=0 ? "" : ".asmx?wsdl");
}


This looks to be a bug with Outlook XP, rather than the
webservice.htc.

I'm curious as to what the recommended workaround to this
problem is.

I could always output the actual URL of each page in a
javascript variable, and then modify webservice.htc to
check that variable, but I really don't want to have to do
that.

Any ideas?

Jay B
 
J

Jay B

Well, I expected at least some kind of acknowledgement
from SOMEONE of the problem, and perhaps an official
answer... seems like there's very little help going on in
these newsgroups unless you're an MSDN Subscriber. Which
makes it real nice for some of us developers who's IT
staff maintains a death grip on MSDN Subscriber
information...


Anyway..

I've chosen to solve this problem by rendering a small
registered client script block during page load that
checks the document.URL for the 'outlook:' moniker, and if
present, resets the document.URL to the value of the
absolute uri. It's an additional web hit, and it
increases the size of every one of our pages, but hey,
it's another MS bug we have to work around.

internal string OutlookXPFixScript( )
{
return "if( document.URL.substr
(0,8) == 'outlook:' )\n{\n\tdocument.URL = \'" +
Request.Url.AbsoluteUri + "\';\n}\n";
}

Jay B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top