Bug 14070 - WCF Udp Discovery in mono
Summary: WCF Udp Discovery in mono
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies (show other bugs)
Version: unspecified
Hardware: PC Linux
: Lowest normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-08-19 08:41 UTC by nesvarbu
Modified: 2016-03-09 15:47 UTC (History)
4 users (show)

See Also:
Tags: mono-community
Is this bug a regression?: ---
Last known good build:


Attachments
Simple code example to reproduce problem. (1.45 KB, text/plain)
2013-08-19 08:41 UTC, nesvarbu
Details

Description nesvarbu 2013-08-19 08:41:35 UTC
Created attachment 4657 [details]
Simple code example to reproduce problem.

Description of Problem:
Can't enable WCF discovery using mono framework. I was following http://msdn.microsoft.com/en-us/library/dd456791.aspx example to test feature. That example works using .NET framework, but fails with mono framework. The problem is in line where is UdpDiscoveryEndpoint added. I'am getting exception:

   Contract 'TargetService' is not implemented in this service 'testService'

Steps to reproduce the problem:
I'am adding attachment with test code.

Actual Results:
Exception.

Expected Results:
Enables WCF discovery on Linux machine(mono) and could be discovered using DiscoveryClient class in windows machine(.NET).

How often does this happen? 
Always

Additional Information:
Using latest mono framework package(mono 3.0.7-1) from Arch linux repositories.
Comment 1 Seifer 2013-12-13 05:02:21 UTC
I experience the same issue.

Mono version: 3.2.5
Operation System: Mac OS X 10.9

Exception:

Unhandled Exception:
System.InvalidOperationException: Contract 'TargetService' is not implemented in this service 'Foo'
  at System.ServiceModel.ServiceHostBase.AddServiceEndpoint (System.ServiceModel.Description.ServiceEndpoint endpoint) [0x00000] in <filename unknown>:0 
  at Test.Main () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Contract 'TargetService' is not implemented in this service 'Foo'
  at System.ServiceModel.ServiceHostBase.AddServiceEndpoint (System.ServiceModel.Description.ServiceEndpoint endpoint) [0x00000] in <filename unknown>:0 
  at Test.Main () [0x00000] in <filename unknown>:0 


Test code:


using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.Discovery;

public class Test
{
	public static void Main ()
	{
		ServiceHost host = new ServiceHost (typeof(Foo));

		host.Description.Behaviors.Add(new ServiceMetadataBehavior());
		host.AddServiceEndpoint(
			typeof(IFoo), 
			new BasicHttpBinding(), 
			"http://localhost:9000/FooService");

		// Add a ServiceDiscoveryBehavior
		host.Description.Behaviors.Add(new ServiceDiscoveryBehavior());

		// Add a UdpDiscoveryEndpoint
		host.AddServiceEndpoint(new UdpDiscoveryEndpoint());

		host.Open ();
		Console.WriteLine ("Hit [CR] key to close ...");
		Console.ReadLine ();
		host.Close ();
	}

	[ServiceContract]
	public interface IFoo
	{
		[OperationContract]
		void Message(string msg);
	}

	public class Foo: IFoo
	{
		public void Message(string msg)
		{
			Console.WriteLine (msg);
		}
	}
}
Comment 2 redmanmale 2016-03-09 15:47:36 UTC
Same for me.
Three years passed, this bug's still here.

Note You need to log in before you can comment on or make changes to this bug.