WCF Test Client: Failed to add service. Service metadata may not be available. Make sure your service is up and running with metadata

I'm currently trying to get a sample synchronization workspace: sample

The solution compiles without any errors or warnings.

But when I got into F5, the WCF test client launches and throws the following error.

Local \ Temp \ Test Client Projects \ 10.0 \ 5b6aab8a-6629-4a12-87c2-e9e75ba9c1e4 \ Client.cs (379,13): error CS0246: The type or name of the namespace "schema" was not found (you are missing the using directive or links to assembly?)

Below is the code from Client.cs that the above error refers to

 /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.1")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.datacontract.org/2004/07/Microsoft.Synchronization")] public partial class SyncIdFormatGroup { private schema schemaField; private System.Xml.XmlElement anyField; /// <remarks/> [System.Xml.Serialization.XmlElementAttribute(Namespace="http://www.w3.org/2001/XMLSchema", Order=0)] public schema schema { get { return this.schemaField; } set { this.schemaField = value; } } /// <remarks/> [System.Xml.Serialization.XmlAnyElementAttribute(Order=1)] public System.Xml.XmlElement Any { get { return this.anyField; } set { this.anyField = value; } } } 

It would be great if someone helped me with this problem.

+4
source share
3 answers

Found a solution. Well, having spent a lot of time, I hacked it. For some reason, if I run the sample as a console application, it just works fine. But at that moment when I use WCFTestClient, I was getting errors. If I remove [ServiceKnownType(typeof(SyncIdFormatGroup))] from the contract, it will work in WCFTestClient. Hope that helps someone.

+3
source

Have you included the mex (metadata) exchange endpoint in your service?

 <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
+2
source

Read the note at the end of the page: Note. If you are using Visual Studio 2010 to compile these samples, you first need to remove the assembly references for the Sync Framework, and then re-add the assembly references for the projects. Otherwise, you will see that errors like "type or name of the space cannot be found". http://code.msdn.microsoft.com/Database-Sync-SQL-Server-7e88adab#content or http://code.msdn.microsoft.com/Database-SyncSQL-Server-e97d1208

0
source

All Articles