简体   繁体   English

有没有一种方法可以强制IIS调用CustomServiceHost?

[英]Is there a way to force IIS to invoke CustomServiceHost?

All, 所有,

I have developed a WCF Web Service and hosted it in IIS7.5. 我已经开发了WCF Web服务并将其托管在IIS7.5中。 The service behavior is instanceContextMode=InstanceContextMode.PerSession and hence IIS creates an service instance during the first requests and creates as many instances as the number of requests. 服务行为是instanceContextMode=InstanceContextMode.PerSession ,因此IIS在第一个请求期间创建一个服务实例,并创建与请求数量一样多的实例。

But there is a requirement to cache some of the application data upfront before the service is invoked ie., similar to static initialization. 但是需要在调用服务之前预先缓存一些应用程序数据,即类似于静态初始化。

I don't want to disturb the service behavior attributes but want to achieve the static initialization. 我不想打扰服务行为属性,但想实现静态初始化。

I did try to use CustomServiceFactory and take up the load of creating service factory instances myself. 我确实尝试过使用CustomServiceFactory并自己承担创建服务工厂实例的负担。 But looks like the IIS will create the service factory as well during first request or I am not sure on this part. 但是看起来IIS也会在首次请求期间创建服务工厂,或者我不确定这部分内容。

So, I would like to know how to create the service instance / service factory instance when the application is deployed in IIS or during IIS restart? 因此,我想知道在IIS中部署应用程序或在IIS重新启动期间如何创建服务实例/服务工厂实例吗?

Any help is much appreciated! 任何帮助深表感谢!

We are using the auto-start feature of AppFabric to initialize the services on application startup/app pool recycle. 我们正在使用AppFabric自动启动功能在应用程序启动/应用程序池回收时初始化服务。 It invokes each service inside the application once during application start. 在应用程序启动期间,它一次调用应用程序内部的每个服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有办法公开 WCF 方法并能够像 asmx 一样调用它们? - Is there any way to expose WCF methods and be able to invoke them like an asmx? 有没有办法确定IIS或网站已停止? - Is there a way to identify that IIS or the website had been stopped? 有没有办法在IIS7.5中订购身份验证? - Is there a way to order the Authentication in IIS7.5? IIS 7.5配置网站以支持http,net.pipe来调用WCF服务 - IIS 7.5 configuring website to support http , net.pipe to invoke WCF service 有没有更简单的方法可以将Silverlight和WCF服务从本地主机发布到IIS? - Is there an easyier way to publish silverlight & wcf services from localhost to IIS? 如何强制IIS托管的WCF或ASMX [webservice]只读取会话对象? - How to force an IIS hosted WCF or ASMX [webservice] to use session object readonly? 有没有办法在没有IIS的情况下使用WCF自定义定义的友好URL? - Is there a way to have custom defined friendly URLs with WCF without IIS? 有没有办法在IIS中仅为网站的某些部分显示自定义错误页面? - Is there a way to display custom error pages in IIS for only parts of a website? 这是通过IIS提供的WCF服务中配置“全局设置”的正确方法吗? - Is this the correct way to configure “Global settings” in WCF Serviced, Delivered through IIS WCF:为IIS托管的服务发送二进制数据的最佳方法 - WCF: Best way to send binary data for IIS-hosted services
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM