2

I have a WCF 3.0 service which has been configured in the web.config of my web application where it's hosted via an .svc file:

<endpoint address="https://domain.co.uk/services/accountservice"
             binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAccountService"
             contract="AccountServiceReference.IAccountService"
             name="BasicHttpBinding_IAccountService" />

The address value shouldn't be in plain text in the web.config, as we'd like to encrypt it with an encryption algorithm that we have and only store the encrypted value there. How would that be possible?

I was thinking perhaps I should be programmatically hosting the WCF service in our IIS so that the address can be set at runtime by reading the EncryptedAddress value from an AppSetting then decrypting it at runtime. How would that be possible?

Kevin Reid
  • 37,492
  • 13
  • 80
  • 108
The Light
  • 26,341
  • 62
  • 176
  • 258
  • Is this in the `services` or in the `client` section? Because the approach differs quite a bit whether you're trying to host or consume a service. In either case: why bother? Because this seems like security through obscurity. – CodeCaster Oct 29 '12 at 13:43
  • You could try to find out how the .svc file extension works. I believe you will find that WCF implements IHttpHandler. You might be able to rebuild that code-path. – usr Oct 29 '12 at 14:04
  • @codecaster actually I'd need to do this for both client and services. – The Light Oct 29 '12 at 14:27

1 Answers1

0

There are already several answers to your question in stack overflow, for example:

How to programatically set a single endpoint for a WCF service

How can I register a WCF service programmatically within an IIS environment

Community
  • 1
  • 1
JotaBe
  • 38,030
  • 8
  • 98
  • 117