M
Michael M
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
HOWEVER
In the web service consumer cannot correctly identify the interface
being used:
public sub Main()
dim obj as IBase = new MyService ' <--- Throws an error
MsgBox(obj.HelloWorld)
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
project.
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.
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
HOWEVER
In the web service consumer cannot correctly identify the interface
being used:
public sub Main()
dim obj as IBase = new MyService ' <--- Throws an error
MsgBox(obj.HelloWorld)
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
project.
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.