tags:

views:

333

answers:

2

I have a web service that receives data in XML. I wish this XML to be encrypted before it is sent and have the serializer handle the decryption. This would let the service methods receive the objects as normal with the encryption detail hidden from them.

I have looked at IOperationBehaviour and inheriting from DataContractSerializerOperationBehavior however I'm finding it hard to find good documentation on how these work and the best way to override/implement them.

Is what I'm trying to do possible? Am I going about it in the right way? Any pointers would be most welcome.

+2  A: 

You could just use wshttpbinding with message encryption (Will not work with REST)

EDIT 1

You can encrypt the transport, which will encrypt the message when it is on the wire. See

http://msdn.microsoft.com/en-us/library/bb924478.aspx

EDIT 2

I agree with John's point below that transport encryption just gives you point-to-point encryption, the message is encrypted on the wire, not through that application layers.

Shiraz Bhaiji
Yes, except that he's decided that he needs the simplicity of REST - except that he also wants encryption.
John Saunders
To be fair I added REST to the title after he answered, as I'm using webHttpBinding
Dominic Godin
I don't understand. If you're using wsHttpBinding, then what's the problem? Also, please update the question to say what you're _actually_ doing.
John Saunders
I'm not I'm using webHttpBinding. Thanks to the answer provider for the update.
Dominic Godin
If point-to-point encryption is adequate, then this will work. WS-Security would be necessary if the message were going through application-layer routers, or more than one transport-level hop.
John Saunders
A: 

Hi,

i am also facing the same problem..

I am having a Rest Web Service, but i would like the Data to be encrypted everythime my Web Service sends or receives.

i am using webHttpBinding, i cannot use wsHttpBinding because my app will not even launch if i use wsHttpBinding.

Can anyone suggest a way to be done?

Really need some help here because i'm developing in C# using WCF and Windows Azure.

Billy Ang