Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > implementing an interface in a web service

Thread Tools

implementing an interface in a web service

Michael M
Posts: n/a
I have a DLL that exposes a simple interface:

public interface IBase

function HelloWorld() as String

end interface

I want to implement this interface as web service.

Now, I have successfully IMPLEMENTED the interface using the standard
implements clause such that:

public class MyService
inherits System.Web.Services.WebService
implements IBase

<WebMethod()> _
Public Function HelloWorld() As String Implements IBase.HelloWorld
Return "This method is called from the web service"
End Function
end class


In the web service consumer cannot correctly identify the interface
being used:

public sub Main()
dim obj as IBase = new MyService ' <--- Throws an error
end sub

I modified the Reference.vb file (proxy) that was generated as a
result of adding the web reference, but this would require me to
modify the Reference.vb file EVERY TIME I added the web reference to a

What I would eventually like to do is to use reflection to instantiate
this object (in case I so choose to implement another consumption
method). Am I just missing an attribute?

I have heard of exposing interfaces over web services, but is there a
trade off for trying to do this as opposed to direct implemeting an
assembly interface.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does timer in Web Service Global.asax block my Web Service from processing web-site requests? Leo Violette ASP .Net Web Services 0 04-17-2009 12:39 AM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
Implementing subscription based Web Service =?Utf-8?B?V2ViTWF0cml4?= ASP .Net 6 12-22-2005 09:53 PM
Implementing Interface Gomathi ASP .Net 1 11-17-2005 03:09 PM
Implementing rate-limit at vlan interface for Cat 6509 Mr_Magoo Cisco 6 05-08-2004 03:26 AM