I am currently developing a WCF Publish Subscribe Service. The publisher would be a asp.net and the subscriber would be a winform app. How do I translate the following code for my asp.net to read and perform the way for it to connect to my service?
class Program : IPostingContractCallback
{
static void Main(string[] args)
{
InstanceContext site = new InstanceContext(new Program());
PostingContractClient client = new PostingContractClient(site);
client.PublishPost("testing");
Console.WriteLine();
Console.WriteLine("Press ENTER to shut down data source");
Console.ReadLine();
//Closing the client gracefully closes the connection and cleans up resources
client.Close();
}
public void PostReceived(string postSampleData)
{
Console.WriteLine("PostChange(item {0})",postSampleData);
}
Managed to translate the service code using the following command
And adding the following codes to my asp.net