[Mono-bugs] [Bug 693367] New: Inherited WebService proxies fail on Invoke.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu May 12 08:39:33 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=693367

https://bugzilla.novell.com/show_bug.cgi?id=693367#c0


           Summary: Inherited WebService proxies fail on Invoke.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.10.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web.Services
        AssignedTo: atsushi at ximian.com
        ReportedBy: thom at union.waw.pl
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1)
Gecko/20100101 Firefox/4.0.1

We define simple webservice proxy (code below is just a problem template):

[System.Web.Service.WebServiceBindingAttribute(Name="blahblah",
Namespace="http://blahblah/blah"]
class FooService : System.Web.Services.Protocols.SoapHttpClientProtocol
{
   public object MyWebMethod()
   {
      object results[]= this.Invoke("MyWebMethod", new object[] { });
      return results[0];
   }
}

class BarService : FooService
{
   public object MyAnotherMethod()
   {
      return MyWebMethod();
   }
}

Calling barService.MyAnotherFunction() throws exception:

WebServiceBindingAttribute is required on proxy class 'BarService'.   at
System.Web.Services.Protocols.SoapTypeStubInfo..ctor
(System.Web.Services.Protocols.LogicalTypeInfo logicalTypeInfo) [0x00000] in
<filename unknown>: 0
  at System.Web.Services.Protocols.LogicalTypeInfo.GetTypeStub (System.String
protocolName) [0x00000] in <filename unknown>:0
  at System.Web.Services.Protocols.TypeStubManager.GetTypeStub (System.Type t,
System.String protocolName) [0x00000] in <filename unknown>:0
  at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor () [0x00000] in
<filename unknown>:0

Above exception occurs on internal class SoapTypeStubInfo defined in
System.Web.Services.Protocols/Methods.cs.

In mono sources I've found in files
System.Web.Services.Protocols/TypeStubManager.cs and
System.Web.Services.Protocols/ServerType.cs wrong calls to find
WebServiceBindingAttribute:

type.GetCustomAttributes (typeof (WebServiceBindingAttribute), false);

I think that this should be changed to:

type.GetCustomAttributes (typeof (WebServiceBindingAttribute), true);

This will find attributes on inherited classes and work like in Microsoft .Net
Framework. Later I'll try to compile locally System.Web.Services and check
above change. If it will work, then I'll try to provide a patch.


Reproducible: Always

Steps to Reproduce:
1. Create new class inheriting from webservice proxy class (eg generated by
wsdl.exe)
2. Call web method on inherited class.
3. Exception occurs.
Actual Results:  
Exception occurs:
WebServiceBindingAttribute is required on proxy class 'BarService'.   at
System.Web.Services.Protocols.SoapTypeStubInfo..ctor
(System.Web.Services.Protocols.LogicalTypeInfo logicalTypeInfo) [0x00000] in
<filename unknown>: 0
  at System.Web.Services.Protocols.LogicalTypeInfo.GetTypeStub (System.String
protocolName) [0x00000] in <filename unknown>:0
  at System.Web.Services.Protocols.TypeStubManager.GetTypeStub (System.Type t,
System.String protocolName) [0x00000] in <filename unknown>:0
  at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor () [0x00000] in
<filename unknown>:0


Expected Results:  
Web service call should work properly.

-- 
Configure bugmail: https://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