Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8312717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:15:09+00:00 2026-06-08T20:15:09+00:00

So I have a client application and a WCF Service publish to an IIS

  • 0

So I have a client application and a WCF Service publish to an IIS server. I successfully was able to get the clients to subscribe to the WCF service and then push out a message to each of the instances of the client app after a button was clicked on any 1 of the clients. Now my goal is to push out the message from the WCF application but through REST in a web browser which would then allow me to use this interface in Android and interact between an Android client and the windows client application. Anyone have any idea what i need to do? Here is the basics of the interface that I have working.

IService.vb:

    <ServiceContract(SessionMode:=SessionMode.Required, CallbackContract:=GetType(IServiceCallback))>
Public Interface IService
    <OperationContract(IsOneWay:=True)>
    Sub GetClientCount()

    <OperationContract(IsOneWay:=True)>
    Sub RegisterClient(ByVal id As Guid)

    <OperationContract(IsOneWay:=True)>
    Sub UnRegisterClient(ByVal id As Guid)
End Interface

Public Interface IServiceCallback
    <OperationContract(IsOneWay:=True)>
    Sub SendCount(ByVal count As Int32)
End Interface

Service.svc.vb

<ServiceBehavior(InstanceContextMode:=InstanceContextMode.Single, ConcurrencyMode:=ConcurrencyMode.Multiple)>
Public Class Service
    Implements IService, IRestService
    Private clients As New Dictionary(Of Client, IServiceCallback)()
    Private locker As New Object()

    Public ReadOnly Property Callback As IServiceCallback
        Get
            Return OperationContext.Current.GetCallbackChannel(Of IServiceCallback)()
        End Get
    End Property

    'called by clients to get count
    Public Sub GetClientCount() Implements IService.GetClientCount
        Dim query = ( _
        From c In clients _
        Select c.Value).ToList()

        Dim action As Action(Of IServiceCallback) = Function(Callback) GetCount(Callback)

        query.ForEach(action)
    End Sub

    Private Function GetCount(ByVal callback As IServiceCallback) As Int32
        callback.SendCount(clients.Count)
        Return Nothing
    End Function

    '---add a newly connected client to the dictionary---
    Public Sub RegisterClient(ByVal guid As Guid) Implements IService.RegisterClient
        '---prevent multiple clients adding at the same time---
        SyncLock locker
            clients.Add(New Client With {.id = guid}, Callback)
        End SyncLock
    End Sub

    '---unregister a client by removing its GUID from 
    ' dictionary---
    Public Sub UnRegisterClient(ByVal guid As Guid) Implements IService.UnRegisterClient
        Dim query = From c In clients.Keys _
                    Where c.id = guid _
                    Select c
        clients.Remove(query.First())
    End Sub
End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:15:10+00:00Added an answer on June 8, 2026 at 8:15 pm

    Generally push based implementation in HTTP is pretty difficult. Commom techniques used to implement this is either Reverse Ajax, Web Sockets or Long Polling(Some even use a single pixel flex object to keep the socket permanently open).
    Check out this Code Project Article, which uses Reverse Ajax aka Commet to implement a wcf rest service capable of push notification.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a WCF Publish/Subscribe service using WSDualHTTPBinding. It allows a server application
I have a WCF service as part of a client/server application I am working
I have client-server application, where server side is Azure WCF service with data in
I have a WCF service hosted on a server. A client application is accessing
I have a client application that connects to a WCF service, I get the
I am trying to learn WCF. I have a simple client and server application
I have client/server application where the client app will open files. Those files get
I have a client service solution containing a Winforms client application and a WCF
I will have a client application using a proxy to a WCF Service. This
I have a light Client application, that makes Asyncronous WCF calls to a IIS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.