سؤال

Ithis issue has already been asked over and over but whatever the solution was on people's project, it doesn't work for me.

I have a WsDualHttpBinding to call a service from a client. My config for the client is this :

 <bindings>
  <wsDualHttpBinding>
    <binding name="wsDualHttpBindingConfiguration" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:05:00" bypassProxyOnLocal="true" />
  </wsDualHttpBinding>
</bindings>

my clients are defined like this a bit further :

<client>
        <endpoint address="http://{ipadress}:60379/ConfigurationCompleterService.svc"
            binding="wsDualHttpBinding" bindingConfiguration="wsDualHttpBindingConfiguration"
            contract="InfluxConfigurationCompleterService.IConfigurationCompleterService"
            name="WSDualHttpBinding_IConfigurationCompleterService">
            <identity>
                <userPrincipalName value="{domain-username}" />
            </identity>
        </endpoint>
      <!--wsDualHttpBindingConfiguration-->
        <endpoint address="http://{ipadress}:60379/ConfigurationImportService.svc"
            binding="wsDualHttpBinding" bindingConfiguration="wsDualHttpBindingConfiguration" 
            contract="ConfigurationImportServiceReference.IConfigurationImportService"
            name="WSDualHttpBinding_IConfigurationImportService">
            <identity>
                <userPrincipalName value="{domain-username}" />
            </identity>
        </endpoint>
    </client>

this work in local mode, on the same machine. When i deploy the service on a server and launch my client i get the following error message after a 1 minute timeout :

Unhandled exception: System.ServiceModel.CommunicationException: Security negotiation failed because the remote party did not send back a reply in a timely manner. This may be because the underlying transport connection was aborted.

I understand that the problem is either because of the port (but here i deployed it especialy on a different one from 80) or security issues.

So i tried to insert security attributes to my binding configuration:

<security mode="none" />

<security mode="message"><message clientCredentialType="None"/></security>

and others that i don't remember. I can't get to my service even on the same machine once I deployed it while it worked fine on VS2012.

My services are well hosted, i can reach them from a web browser and from distant machines.

Thanks in advance.

PS : Is there any way to configure WsDualHttpBinding in an absolutely non secure way, that would not ask any credential at all?

هل كانت مفيدة؟

المحلول

I had the same issue, but it was because of my client code. For example:

WSDualHttpBinding binding = new WSDualHttpBinding();
binding.Security.Mode = WSDualHttpSecurityMode.None; <-- I forgot this line.
EndpointAddress endpoint = new EndpointAddress("http://localhost/CardService.svc");
DuplexChannelFactory<ICardService> channelFactory = new DuplexChannelFactory<ICardService>(this, binding, endpoint);
ICardService channel = channelFactory.CreateChannel();
string message = "Hello, service.";
Console.WriteLine("Successfully created the channel. Pinging it with message \"{0}\".", message);
channel.Ping(message);
Console.WriteLine("Successfully pinged the channel.");
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top