public SoapDocumentationHandler (Type type, HttpContext context): base (type)
{
_url = context.Request.Url.ToString();
- int i = _url.LastIndexOf ('?');
+ int i = _url.IndexOf ('?');
if (i != -1) _url = _url.Substring (0,i);
_typeStubInfo = (SoapTypeStubInfo) TypeStubManager.GetTypeStub (ServiceType, "Soap");
if (key == "wsdl" || key == "schema" || key == "code" || key == "disco")
return;
-#if NET_2_0
string help = WebServicesSection.Current.WsdlHelpGenerator.Href;
string path = Path.GetDirectoryName (ConfigurationManager.OpenMachineConfiguration().FilePath);
-#else
- string help = WSConfig.Instance.WsdlHelpPage;
- string path = Path.GetDirectoryName (WSConfig.Instance.ConfigFilePath);
-#endif
string appPath = AppDomain.CurrentDomain.GetData (".appPath").ToString ();
string vpath;
if (path.StartsWith (appPath)) {
string physPath = Path.Combine (path, help);
-#if !TARGET_JVM
if (!File.Exists (physPath))
throw new InvalidOperationException ("Documentation page '" + physPath + "' not found");
-#endif
-#if NET_2_0
- // Since BuildManager expects the virtualPath to be mappable into the
- // application virtual root directory and the WSDL help generator possibly
- // lives outside the location (by default in $prefix/etc/mono/2.0/), we need
- // to use a fake virtual path which will be recognized by the page builder
- // and processed accordingly.
- // The fake virtual path prefix is defined in
- // BuildManager.FAKE_VIRTUAL_PATH_PREFIX constant
- _pageHandler = BuildManager.CreateInstanceFromVirtualPath ("/@@MonoFakeVirtualPath@@" + physPath, typeof (IHttpHandler)) as IHttpHandler;
-#else
_pageHandler = PageParser.GetCompiledPageInstance (vpath, physPath, context);
-#endif
-
}
internal IHttpHandler PageHandler {
if (key == "wsdl") GenerateWsdlDocument (context, req.QueryString ["wsdl"]);
else if (key == "schema") GenerateSchema (context, req.QueryString ["schema"]);
-#if !TARGET_JVM //code generation is not supported
else if (key == "code") GenerateCode (context, req.QueryString ["code"]);
-#else
- else if (key == "code") throw new Exception("Code generation is not supported.");
-#endif
else if (key == "disco") GenerateDiscoDocument (context);
else throw new Exception ("This should never happen");
}
GetSchemas() [di].Write (xtw);
}
-#if !TARGET_JVM
void GenerateCode (HttpContext context, string langId)
{
context.Response.ContentType = "text/plain; charset=utf-8";
return provider;
}
-#endif
internal ServiceDescriptionCollection GetDescriptions ()
{