Reputation: 35
In my dll I have a server reference to a web service. This WCF web service becomes visible to my client application that uses the dll. Is there a way to prevent this?
Thanks.
Upvotes: 0
Views: 956
Reputation: 31760
If the reference is built into the URL then you will have to handle the fact it will be visible. The alternative is to not use service references. You can still call the service without a service reference by using the WCF channel stack in code.
To do this your client only needs a references to the service interface and the types which are exposed on the service's operations. Then you can use ChannelFactory<ServiceInterface>("NameOfServiceInConfigFile").CreateChannel()
to return your proxy.
Upvotes: 0
Reputation: 14956
When adding the service reference, click the "Advanced" button. This will give you the option to generate all client service classes as internal instead of public.
Upvotes: 3