none
Unable to Get My WCF Duplex Client to work, Please Help! RRS feed

  • Question

  • Class GameServiceCallback
        Implements IGameService
        Implements IGameServiceCallback
    
        Public Function BeginTriggerGameAction(gameId As Long, playerId As Long, settings As String, callback As AsyncCallback, asyncState As Object) As IAsyncResult Implements IGameService.BeginTriggerGameAction
            Return gameId.ToString
        End Function
    
        Public Sub EndTriggerGameAction(result As IAsyncResult) Implements IGameService.EndTriggerGameAction
    
        End Sub
    
        Public Sub TriggerGameAction(gameId As Long, playerId As Long, settings As String) Implements IGameService.TriggerGameAction
    
        End Sub
    
        Public Function BeginNotifyAction(gameId As Long, playerId As Long, settings As String, callback As AsyncCallback, asyncState As Object) As IAsyncResult Implements IGameServiceCallback.BeginNotifyAction
            Return gameId.ToString
        End Function
    
        Public Sub EndNotifyAction(result As IAsyncResult) Implements IGameServiceCallback.EndNotifyAction
    
        End Sub
    
        Public Sub NotifyAction(gameId As Long, playerId As Long, settings As String) Implements IGameServiceCallback.NotifyAction
            Console.WriteLine("Result({0})", gameId)
    
        End Sub
    End Class
    Class MainWindow
        Dim xY As New ServiceModel.InstanceContext(New GameServiceCallback())
    
        Dim WithEvents x As New GameService.GameServiceClient(xY)
        Private Sub CheckClient()
            Dim y As ServiceModel.Description.ServiceEndpoint = x.Endpoint
            x.TriggerGameActionAsync(1234, 1234, "ASdasd")
            'x.Open()
        End Sub

    Above is my client Implementation, Whenever I try to open my WCF Client, I get Timeout Exception, Please Help.

    My App.Config Code:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
        </startup>
        <system.serviceModel>
            <bindings>
                <wsDualHttpBinding>
                  <binding name="WSDualHttpBinding_IGameService" useDefaultWebProxy="True">
                    <security mode="None"/>
                  </binding>
                </wsDualHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://SomeDomain/Services/GameService.svc"
                    binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IGameService"
                    contract="GameService.IGameService" name="WSDualHttpBinding_IGameService">
                    <identity>
                        <dns value="localhost" />
                    </identity>
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>


    Prashant.AD


    Wednesday, April 10, 2013 8:19 AM

Answers

  • Hi,

    For time out issue, please try increase the closeTimeout, openTimeout, receiveTimeout and sendTimeout for the binding of both the service and client.

    If it does not work, more information is needed to troubleshoot the issue, you can enable tracing as Sukumar suggested to help to get the root cause of the timeout exception.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, April 11, 2013 2:46 AM
    Moderator

All replies