[RESOLVED] Access method of ServiceHost type
So I have a WCF Service that has service methods. One of the methods needs to be called from the application that is hosting the service. I am using a ServiceHost to host it.
vb.net Code:
Dim url As Uri = New Uri(String.Format("net.tcp://localhost:{0}/FFXIChat", Me.nuPort.Value)))
_host = New ServiceHost(GetType(Contracts.Server.FFXIChatServer), url)
_host.Open()
Now the FFXIChatServer has a method that needs to be called from with in this form that contains the ServiceHost. Is there any way to access the object that is contained in the ServiceHost? I have done a bunch of searching and haven't found anything. Any and all help is appreciated as always.
Re: Access method of ServiceHost type
Actually nevermind, I figured it out.
I had to set the ServiceBehavior InstanceContextMode to Single in the service and then Pass and object reference to the ServiceHost Constructor.