<%@ Page Language="C#" Inherits="System.Web.UI.Page" %> <%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint.Utilities" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Import Namespace="Microsoft.SharePoint.WebControls" %> <% SPSite spServer = SPControl.GetContextSite(Context); SPWeb spWeb = SPControl.GetContextWeb(Context); %> <% string OriginalBaseUrl = HttpUtility.UrlDecode(SPWeb.OriginalBaseUrl(Request)); bool isAdminWebService = false; string webUrl = HttpUtility.UrlDecode(spWeb.Url + "/_vti_bin/"); if (String.Compare(webUrl,0,OriginalBaseUrl,0,webUrl.Length,true) != 0) { webUrl = HttpUtility.UrlDecode(spWeb.Url + "/_vti_adm/"); if (String.Compare(webUrl,0,OriginalBaseUrl,0,webUrl.Length,true) == 0) { isAdminWebService = true; } else throw new System.IO.FileNotFoundException(OriginalBaseUrl); } int i; if (isAdminWebService) i = OriginalBaseUrl.LastIndexOf("/_vti_adm/", StringComparison.InvariantCultureIgnoreCase); else i = OriginalBaseUrl.LastIndexOf("/_vti_bin/", StringComparison.InvariantCultureIgnoreCase) + 10; int j = OriginalBaseUrl.LastIndexOf('.'); string newUrl = ""; if (j != -1 && i < j ) { newUrl = OriginalBaseUrl.Substring(i,j-i); newUrl += "wsdl.aspx"; if (isAdminWebService) { newUrl = "/_vti_adm/" + newUrl; } try { Server.Execute(newUrl); } catch (HttpException) { throw new System.IO.FileNotFoundException(OriginalBaseUrl); } } else throw new System.IO.FileNotFoundException(OriginalBaseUrl); %>