You have a WCF Service that needs a SPN from its client But We typically use client config file to send the spn using the below code:
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttp"
name="BasicEndPoint" bindingNamespace="TestNamespace"
contract="IService">
<identity>
<servicePrincipalName value="HTTP/TEST"/>
</identity>
</endpoint>
But in case of .net vetsion 3.5 SP1 i is not working at all because the WCF client is not sent the spn value from config files. So it was not work at all
Use the below code to force fully send the SPN name to a WCF Service from a WCF Client:
IService proxy = null;
ChannelFactory<IService> factory = null;
EndpointIdentity identity = null;
EndpointAddress address = null;
if (!string.IsNullOrEmpty(spnName))
identity = EndpointIdentity.CreateSpnIdentity(spnName);
if (identity != null)
address = new EndpointAddress(new Uri(webServiceUrl), identity);
else
address = new EndpointAddress(new Uri(webServiceUrl));
factory = new ChannelFactory<IService>(bindingName, address);
factory.Credentials.Windows.AllowNtlm = true;
factory.Credentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Delegation;
proxy = factory.CreateChannel();
use this Proxy Object you can call operations of the service and also send SPN Properly