[Mono-bugs] [Bug 533166] New: No @webservice directive found for precompiled webservice accessed from client proxy.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Aug 21 02:43:46 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=533166


           Summary: No @webservice directive found for precompiled
                    webservice accessed from client proxy.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: i386
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: chrisbrown76 at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=314446)
 --> (http://bugzilla.novell.com/attachment.cgi?id=314446)
Source and precompiled test example

User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0;
Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)

The error 'No @webservice directive found' is returned as a 500 Internal Server
Error when a webservice is accessed from a client-side proxy for a precompiled
web application. Calls to webservice methods on the class from the browser
subsequently fail.

Reproducible: Always

Steps to Reproduce:
1. Create new ASP.NET web site in VS.NET.
2. Add a new web service to the project.
3. Add a project reference to 'System.Web.Extensions'.
4. Add a reference to System.Web.Script.Services in the webservice and mark the
class with the 'ScriptService' attribute.
4. In the Default.aspx page add a ScriptManager control and add a
ServiceReference to the webservice.
5. Add Javascript to call a method on the webservice e.g during window.onload.
6. Precompile using aspnet_compiler.
7. Copy to Mono environment and run with xsp2.
8. Browse to Default.aspx.
Actual Results:  
The webservice file fails to load with the server returning a 500 Internal
Server Error with the following error message:

Description: HTTP 500. Error processing request.

Stack Trace:

System.Web.Compilation.ParseException: No @webservice directive found
  at System.Web.UI.SimpleWebHandlerParser.GetDirectivesAndContent () [0x0024f]
in
/root/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs:221
  at System.Web.UI.SimpleWebHandlerParser..ctor (System.Web.HttpContext
context, System.String virtualPath, System.String physicalPath,
System.IO.TextReader reader) [0x0017d] in
/root/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs:126
  at System.Web.UI.SimpleWebHandlerParser..ctor (System.Web.HttpContext
context, System.String virtualPath, System.String physicalPath) [0x00000] in
/root/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web/UplevelHelper.cs:1
  at System.Web.UI.WebServiceParser..ctor (System.Web.HttpContext context,
System.String virtualPath, System.String physicalPath) [0x00000] in
/root/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web/UplevelHelper.cs:1
  at System.Web.UI.WebServiceParser.GetCompiledType (System.String inputFile,
System.Web.HttpContext context) [0x00028] in
/root/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web.UI/WebServiceParser.cs:68
  at System.Web.Script.Services.ScriptHandlerFactory.GetHandler
(System.Web.HttpContext context, System.String requestType, System.String url,
System.String pathTranslated) [0x000a2] in
/usr/src/packages/BUILD/mono-2.4.2.3/mcs/class/System.Web.Extensions/System.Web.Script.Services/ScriptHandlerFactory.cs:68
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url, Boolean ignoreContextHandler) [0x00055] in
/root/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web/HttpApplication.cs:1635
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url) [0x00000] in
/root/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web/HttpApplication.cs:1616
  at System.Web.HttpApplication+<Pipeline>c__Iterator2.MoveNext () [0x0071f] in
/root/Desktop/mono-2.4.2.3/mcs/class/System.Web/System.Web/HttpApplication.cs:1252

Version information: Mono Version: 2.0.50727.1433; ASP.NET Version:
2.0.50727.1433 

This results in a 'xxxclass is not defined' Javascript error in the client
browser when a webservice method is called.

Expected Results:  
Asmx file loaded correctly from aspx and webservice method call succeeded. 

It appears that the System.Web.UI.SimplWebHandlerParser.GetDirectivesAndContent
method attempts to find a '@webservice' directive in the precompiled asmx file
which of course only contains 'Content:This is a marker file generated by the
precompilation tool, and should not be deleted!'. Consequently it fails to find
the directive and a ParseException is thrown.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list