none
UAG with Silverlight and net.tcp WCF service

    Question

  • Hello,

    I am troubleshooting a Silverlight app that is exposed through UAG.  The same application works without any trouble inside our network - the problems are only when we use UAG.

    The problem comes when the Silverlight app is initializing the channel for a WCF service (hosted in a Windows Service) inside the network.

    The Silverlight app does its authentication just fine.  When it tries to connect to the net.tcp WCF service, it gets the required clientaccesspolicy.xml file from the host server (which is currently open to allow all connections from all URI domains).

    On the server hosting the service, I ran WireShark and was able to see the tcp connection started (3 packets - [SYN], [SYN, ACK], and [ACK]).  That's where it stops.  The Silverlight side of the channel remains in the "Opening" state.  We were watching the tunnel, and at first it disappeared after 5 seconds.  I found that this was because the default "ChannelInitializationTimeout" for the tcptransport part of the WCF binding defaults to 5 seconds.  I increased it to 5 minutes, and now the tunnel lasts for - you guessed it - 5 minutes.  Longer timeouts just increase the time that the tunnel hangs around, until it closes itself due to no activity.

    Any thoughts where to go from here?  I have WCF service tracing set up on the server where the WCF service resides, and it only tells me that it receives bytes from the UAG client, then nothing until the timeout exception is thrown.  If people from both the UAG and the Silverlight/WCF group could put their heads together on this, I would greatly appreciate it.

    My bindings:

            <binding name="EDBDataListsService.EDBDataLists.netTcpBinding" receiveTimeout="01:00:00" sendTimeout="00:10:00" openTimeout="00:00:15" closeTimeout="00:00:15" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
              <binaryMessageEncoding maxReadPoolSize="64" maxWritePoolSize="32" maxSessionSize="2147483647">
                <readerQuotas maxDepth="64" maxStringContentLength="131072" maxArrayLength="16384" maxBytesPerRead="16384" maxNameTableCharCount="32768" />
              </binaryMessageEncoding>
              <tcpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" hostNameComparisonMode="WeakWildcard" channelInitializationTimeout="00:05:00">
              </tcpTransport>
            </binding>
            <binding name="EDBDataListsService.EDBMonitor.netTcpBinding" receiveTimeout="01:00:00" sendTimeout="00:10:00" openTimeout="00:00:15" closeTimeout="00:00:15" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
              <binaryMessageEncoding maxReadPoolSize="64" maxWritePoolSize="32" maxSessionSize="2147483647">
                <readerQuotas maxDepth="64" maxStringContentLength="131072" maxArrayLength="16384" maxBytesPerRead="16384" maxNameTableCharCount="32768" />
              </binaryMessageEncoding>
              <tcpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" hostNameComparisonMode="WeakWildcard" channelInitializationTimeout="00:05:00">
              </tcpTransport>
            </binding>
              <binding name="EDBMexBinding">
                <tcpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" hostNameComparisonMode="WeakWildcard" channelInitializationTimeout="00:05:00">             
                </tcpTransport>
              </binding>
          </customBinding>
    Thanks!

    Monday, September 30, 2013 8:16 PM