I wonder is this even possible, and if yes then how.
In the plain WCF it's possible to override CreateServiceHost, take ServiceEndpoint instance from service host's Description.Endpoints array, and modify it as needed (in my case it's about adding some method dynamically, like
here). But in Azure (WCF Service Web Role), yes I can override CreateServiceHost, and the Description.Endpoints array is there, but it's empty! The ServiceEndpoint instance appears only after Opened event of the service host, but
then it's too late to modify it (in my case calling that dynamic method would fail, even if it showed up OK in the method list).
Now what should I do to get access to the ServiceEndpoint instance early enough to modify it successfully?
Did you define the service endpoint explicitly in web.config? if you didn't define the endpints, you will not get any endpoints in CreateServiceHost, the default endpoint would be added in the post process.
Define endpoint explicitly may solve your problem.