mardi 30 août 2016

How can I inject a behaviour into WebServiceHost?

I'm instancing a WebServiceHost object:

var _webService = New WebServiceHost(GetType(MyWebServiceImpl), New Uri("http://localhost:8000"));

I need to inject some behaviour (i.e. a DB connection and a logger) into the object of class MyWebServiceImpl, but I don't have a reference to it, because this object is instanciated by the WebServiceHost constructor.

How can I get a reference to the MyWebServiceImpl object? Or is there some pattern I can use to get it?

Thanks

Aucun commentaire:

Enregistrer un commentaire