1

I'm STUCK and have no IDEA why I can't connect to my WCF!!!

Details:

I have a duplex WCF, it successfully run and work in my local window. I host it in server (IIS - server 2008 R2-STANDARD), and trying to connect, but get an error seems like a security issue, I can access it from the web browser and get all the xml....

In my client I'm trying to access it as following:

this.myCallbackProxy = new MyCallbackProxy();
  InstanceContext cntx = new InstanceContext(myCallbackProxy);
  this.Proxy = new MyServiceClientProxy(cntx, "WSDualHttpBinding_I_BridgeWCFService");

//I try also to add the following, not works

this.Proxy.ClientCredentials.Windows.ClientCredential.UserName = "YY";
  this.Proxy.ClientCredentials.Windows.ClientCredential.Password = "PP";

The above passed with no errors or Exceptions. then:

try
{
this.Proxy.Open();
}
catch { -> here I get an exception:

Exception:

The open operation did not complete within the allotted timeout of 00:00:59.0849477. The time allotted to this operation may have been a portion of a longer timeout.

I must mention that I have another WCF hosted in same IIS (not duplex), with same user (server user name), and it works perfect. (I'm using same application poll for both, I also tried to create new application pool.

If I past the link "http://xx.xx.xx.xx/_Bridge/_BridgeWcfService.svc" in the web browser from the machine I want to run the application, I get the xml... as expected.

Both service and client have security = "none"

Any Idea why I can't connect :(?

Here the App.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
  <wsDualHttpBinding>
    <binding name="WSDualHttpBinding_I_BridgeWCFService" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
      maxBufferPoolSize="2147483646" maxReceivedMessageSize="2147483646"
      messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483646"
        maxArrayLength="2147483646" maxBytesPerRead="2147483646" maxNameTableCharCount="2147483646" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00"/>
      <security mode="None"/>
    </binding>
  </wsDualHttpBinding>
</bindings>
<client>
  <endpoint address="http://xx.xx.xx.xx/_Bridge/_BridgeWcfService.svc" 
            binding="wsDualHttpBinding" 
            bindingConfiguration="WSDualHttpBinding_I_BridgeWCFService" 
            contract="_BridgeWcfServiceReference.I_BridgeWCFService" 
            name="WSDualHttpBinding_I_BridgeWCFService">
    <identity>
      <dns value="localhost"/>
    </identity>
  </endpoint>
</client>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
  </startup>
</configuration>
Joseph
  • 1,716
  • 3
  • 24
  • 42
  • What are the other operations on your service proxy? Can you call those instead of Open()? – tom redfern Jan 19 '12 at 19:56
  • No!!!, if I remove the open here, any operation throw same exception: "The open operation did not complete within the allotted timeout of 00:00:59.9939996. The time allotted to this operation may have been a portion of a longer timeout." – Joseph Jan 20 '12 at 20:14

1 Answers1

1

This sounds like a firewall issue - wsDualHttpBinding is prone to blowing up as soon as a firewall is involved as it tries to open a connection from the server back to the client. I'd advise using NetTcpBinding for your duplex communication.

I blogged about this here

Richard Blewett
  • 6,089
  • 1
  • 18
  • 23
  • Hi, I find the problem, its simply the firewall in the test application side which block the income channel from server during the duplex connection for call back. thanks to Richard Blewett All the time i tried to play with the server while the problem in my local PC (I just turn off the firwale in my pc) and it works. – Joseph Jan 23 '12 at 07:38