none
WCf Duplex call back issue with wpf RRS feed

  • Question

  • We are consuming wpf service in the wpf application and we are using net tcp binding. When we uploading web.config after changes on the server then wpf application call the service and when we closing application and running again then service does not call back and no any error raising. I am very confused related to this problem. Locally is working very well. Please see my web.config file-

    <configuration>
      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
      </appSettings>
      <system.web>
        <compilation debug="true" targetFramework="4.5" />
        <httpRuntime targetFramework="4.5"/>
        <customErrors mode="Off"></customErrors>
      </system.web>
      <system.net>
        <defaultProxy>
          <proxy autoDetect="True"/>
        </defaultProxy>
      </system.net>
      <system.serviceModel>
        <bindings>
          <netTcpBinding>
            <binding
                     closeTimeout="00:01:00"
                     openTimeout="00:01:00"
                     receiveTimeout="00:10:00"
                     sendTimeout="00:01:00"
                     transactionFlow="false"
                     transferMode="Buffered"
                     transactionProtocol="OleTransactions"
                     hostNameComparisonMode="StrongWildcard"
                     listenBacklog="10"
                     maxBufferPoolSize="524288"
                     maxBufferSize="65536"
                     maxConnections="10"
                     maxReceivedMessageSize="65536">
              <readerQuotas maxDepth="32"
                            maxStringContentLength="8192"
                            maxArrayLength="16384"
                            maxBytesPerRead="4096"
                            maxNameTableCharCount="16384" />
              <reliableSession ordered="true"
                               inactivityTimeout="00:10:00"
                               enabled="false" />
              <security mode="None">
              </security>
            </binding>
          </netTcpBinding>
        </bindings>
        <services>
          <service name="WidgetsAppService.SessionsController">
            <endpoint address="SessionsController" binding="netTcpBinding" contract="WidgetsAppService.Interfaces.ISessionsController" />
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://45.35.48.186:8002"/>
              </baseAddresses>
            </host>
          </service>
          <service name="WidgetsAppService.ServiceWithCallback">
            <endpoint address="ServiceWithCallback" binding="netTcpBinding" contract="WidgetsAppService.Interfaces.IServiceWithCallback" />
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://45.35.48.186:8002"/>
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <protocolMapping>
          <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
        <directoryBrowse enabled="true"/>
      </system.webServer>
    </configuration>

    Please guide me what is the problem in my code.

    Tuesday, August 30, 2016 11:34 AM

All replies

  • Hi AnkitKumar,

    Do you mean you that your service is hosted in WPF and your client is consumed by WPF?

    When did this issue happen? Did your service never work between service and client or your service did not work after you modifying web.config?

    >>service does not call back and no any error raising.

    Did your client call service method correctly and service could not call client callback or both client and service could not call each other’s method?

    Based on your web.config, there are two services, WidgetsAppService.SessionsController and WidgetsAppService.ServiceWithCallback. Both of them are implemented by Duplex services? It would be helpful if you could share us your simple project which could reproduce your issue.

    For duplex service with NetTcpBinding in WCF, I suggest you refer the link below:

    #Duplex Service in WCF

    http://www.codeproject.com/Articles/660479/Duplex-Service-in-WCF

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, August 31, 2016 3:24 AM
  • We  need to push message on the client machine if client is register with service. And when we running wpf app first time then its showing message from the application and again when we run the its not got any message from the server and when we restarting the wcf service then it's sending  again message. we are very confused about this. We need to send same message to  multiple client at a time. Please guide me.

    Summarized issue is:- Client (App) registering or sending request on server but call back function is not responding from the server.  and no any error occurred

    2-And when server send response by callback function on one machine then its not sending on another machine. (we are running exe of wpf application on more  than one machine.)

    Please help me for find out error.

    thanks

    Thursday, September 1, 2016 7:32 AM
  • Hi AnkitKumar,

    >> Client (App) registering or sending request on server but call back function is not responding from the server

    How did you implement service in server side, and how did you consumer callback at client side? It would be helpful if you could share us related code.

    >> And when server send response by callback function on one machine then its not sending on another machine

    What do you mean by sending response by callback? As my understanding, Duplex is used for service side to call method in client side. That is to say that, at the time of call back, the service behaves as a client as well as the client becomes the service, and the client must assist hosting the call back object. Response from server side is sent by server instead of callback. In addition, it only calls the callback in the client which sends request, it would not call other clients if they do not send requests to service.

    For more information about Duplex, I suggest you refer the link in my first reply.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Friday, September 2, 2016 7:16 AM