简体   繁体   中英

How to Intercept Outbound WCF Service Calls from a .NET Web Application

The .NET web applications we build all integrate with a third party application through a WCF service. Every time a page loads a number of WCF service calls are made to retrieve data that are used to populate some user controls.

Through AppDynamics I can tell that there could be up to 8 WCF calls to load a given page. AppDynamics tells us that the WCF calls cost up to 85% of the load time. This is a serious impact on developer productivity.

Is there a way to intercept all the outbound WCF calls from our .NET web application and stub them with fake data so that pages will not break and load faster? The pages do not need these data to run in development environment.

Thanks for your input!

John

Use Dependency Injection instead of creating the actual WCF endpoints and passing them around. Then mocking them up is trivial. You would then use the interface and let DI take care of the rest!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM