1

Can anyone tell me the difference between transport and message level security codes. Also, how to use them. I am getting the below error when I am using the message security mode :

<message algorithmSuite="Default" clientCredentialType="UserName"/> 

Exception :

System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.ServiceModel.ChannelFactory`1 cannot be used for communication because it is in the Faulted state.

2 Answers 2

3

Message security encrypts each individual message to protect sensitive data. Transport security secures the end-to-end network connection to protect the network traffic.

Use the following transport security criteria to decide whether to use it or not:

Point-to-point. Transport security supports point-to-point communication and does not support intermediary scenarios or protocol transition.

Streaming. Transport security can support streaming data scenarios.

Binding limitations. Transport security does not work with the wsDualHttpBinding.

Authentication limitations. Transport security does not work with negotiation, username or Kerberos direct authentication.

Use the following message security criteria to decide whether to use it or not:

Intermediaries. Message security supports scenarios with intermediaries or protocol transition.

Encryption flexibility. Message security allows you to encrypt part of message while leaving other parts in clear-text.

Binding limitations. Message security does not work with the netNamedPipeBinding. Secure conversations. Secure conversation only works with message security.

Authentication limitations. Message security does not work with basic or digest authentication.

Sign up to request clarification or add additional context in comments.

Comments

0

The error you get is probably not the one at the origin of your problem. To see what really happens, try to use the service proxy defined below:

public class ServiceProxy<T> : IDisposable where T : class, ICommunicationObject { public ServiceProxy(T client) { Client = client; } public T Client { get; private set; } public void Dispose() { if (Client != null && Client.State != CommunicationState.Closed && Client.State != CommunicationState.Faulted) { Client.Close(); } } } 

and use it this way:

using (var c = new ServiceProxy<[yourservicetypehere]>(new [yourservicetypehere]())) { try { var rep = c.Client.[yourservicemethodhere](......); } catch (Exception exception) { // Trap exception here to see what is really happening. } finally { c.Client.Close(); } } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.