I worked through building a WCF duplex service on my development machine. I built the service, created a test client, tested everything and it works. . Then I got gutsy and moved it to my production server.Now that I've moved to the production server I can't use the duplex service. block for sometime and give timeout error
Service web.config
<?XML version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true" target Framework="4.0">
</compilation>
<authentication mode="Windows"/>
<pages compatibility="3.5" client ID Mode="Auto ID"/>
</system.web>
<system.serviceModel>
<services>
<service name="WCFDuplex.Service1" behaviorConfiguration="WCFDuplex.Service1Behavior">
<endpoint address="http://Productionserver:8088/sampleWCF/Service1.svc" binding="wsDualHttpBinding" contract="WCFDuplex.IServiceDuplex">
<identity>
<dns value="Productionserver"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WCFDuplex.Service1Behavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Client app.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IServiceDuplex" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" >
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:01:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default"/>
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://Productionserver:8088/sampleWCF/Service1.svc" binding="wsDualHttpBinding"
bindingConfiguration="WSDualHttpBinding_IServiceDuplex" contract="IServiceDuplex"
name="WSDualHttpBinding_IServiceDuplex">
<identity>
<dns value="Productionserver" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
Client code:
static void Main(string[] args)
{
EndpointAddress endPointAddress = new EndpointAddress("http://ProductionServer:8088/sampleWCF/Service1.svc");
try
{
InstanceContext instanceContext = new InstanceContext(new CallbackHandler());
ServiceDuplexClient client = new
ServiceDuplexClient(instanceContext, new WSDualHttpBinding(), endPointAddress);
client.ClientCredentials.UserName.UserName = "bipin";
client.ClientCredentials.UserName.Password = "pass@123";
client.Open();
client.GetDataFromXml();
}
catch (Exception ex)
{
Console.WriteLine(string.Format("Error connecting to service. {0}", ex.Message));
}
Console.ReadLine();
}
I getting error when open proxy : i.e client.Open();
Client is unable to finish the security negotiation within the configured timeout (00:00:00). The current negotiation leg is 1 (00:00:00). Source=mscorlib
Please help me to sort out this error. any help will be appreciable. thanks.