How to create a trimmed service in WCF -
I have a WCF service with many methods and data contracts, it is usually consumed by large applications "A" I want to make a small application "B" which will use a lot of servers, but only a few ways of service I want to reduce the size of the XAP, and since the client is using all the methods that are revealed by the service , So I created a by Visual Studio To want smaller service reference file. I can remove methods that are not used manually but then I can not really use updated service commands.
Any solution?
Many thanks, Karol
OK, so you have a lot of ways Along with a full IGreatService interface, which has been implemented on a MyGreatService class.
How about this: You create a new, second interface IMyServiceB, in which only some of those methods you want to display to the second group of users. You make it so that your service applies to IGreatService and IMyServiceB (which is absolutely possible, no problem):
Public class MyGreatService: IGreatService, IMyServiceB {..} public IGreatService, IMyServiceB {.... defined as IGreatService Public Zero MethodA (....) {} .... Public Zero MethodB (.....) // as defined on IMSASBB { MethodA (); }}
In this way, you get two different interfaces (= services), but basically you write your code only once.
You can unselect IMyServiceB on a separate and separate endpoint, so that users can only connect to a different endpoint to see the IMISBSBB, and they only serve your Service-B operations. They will be able to get whatever they want to use.
Can this work?
Mark
Comments
Post a Comment