Problem with server code

Dec 16, 2013 at 1:40 PM
Hi,

after creating the
DefaultScopeSyncService.svc
DefaultScopeSyncService.svc.cs
DefaultScopeEntities.cs

and configuring the connection string in the DefaultScopeSyncService.svc.cs the service can't start it says the following:

Error: Cannot obtain Metadata from http://localhost:51993/SFWdeamo/DefaultScopeSyncService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://localhost:51993/SFWdeamo/DefaultScopeSyncService.svc Metadata contains a reference that cannot be resolved: 'http://localhost:51993/SFWdeamo/DefaultScopeSyncService.svc'. The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.HTTP GET Error URI: http://localhost:51993/SFWdeamo/DefaultScopeSyncService.svc There was an error downloading 'http://localhost:51993/SFWdeamo/DefaultScopeSyncService.svc'. The request failed with the error message:--<!DOCTYPE html><html> <head> <title>The type 'DefaultScope.DefaultScopeSyncService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.</title> <meta name="viewport" content="width=device-width" /> <style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } @media screen and (max-width: 639px) { pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; } } @media screen and (max-width: 479px) { pre { width: 280px; } } </style> </head> <body bgcolor="white"> <span><H1>Server Error in '/SFWdeamo' Application.<hr width=100% size=1 color=silver></H1> <h2> <i>The type 'DefaultScope.DefaultScopeSyncService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.</i> </h2></span> <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "> <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br><br> <b> Exception Details: </b>System.InvalidOperationException: The type 'DefaultScope.DefaultScopeSyncService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.<br><br> <b>Source Error:</b> <br><br> <table width=100% bgcolor="#ffffcc"> <tr> <td> <code>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code> </td> </tr> </table> <br> <b>Stack Trace:</b> <br><br> <table width=100% bgcolor="#ffffcc"> <tr> <td> <code><pre>[InvalidOperationException: The type 'DefaultScope.DefaultScopeSyncService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.] System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +62739 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1429 System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +52 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +598[ServiceActivationException: The service '/SFWdeamo/DefaultScopeSyncService.svc' cannot be activated due to an exception during compilation. The exception message is: The type 'DefaultScope.DefaultScopeSyncService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found..] System.Runtime.AsyncResult.End(IAsyncResult result) +485044 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +174 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) +229 System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +328 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69</pre></code> </td> </tr> </table> <br> <hr width=100% size=1 color=silver> <b>Version Information:</b>ÿMicrosoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.33440 </font> </body></html><!-- [InvalidOperationException]: The type 'DefaultScope.DefaultScopeSyncService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found. at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)[ServiceActivationException]: The service '/SFWdeamo/DefaultScopeSyncService.svc' cannot be activated due to an exception during compilation. The exception message is: The type 'DefaultScope.DefaultScopeSyncService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.. at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)-->--.
Coordinator
Dec 16, 2013 at 10:09 PM
Hum, IMO, It could be :
  1. Your connection string is not correct
  2. You don't have correctly installed the sync Framework 2.1
  3. You don't have provision the database
Dec 17, 2013 at 8:23 AM
  1. Your connection string is not correct.
    It's Ok tried it with sqldatasource and found it working well.
  2. You don't have correctly installed the sync Framework 2.1
    Please would you tell me exactly how to install the sync framework 2.1 on 64x. because what is written in the tutorial is not clear enough.
  3. You don't have provision the database
    It's Ok the triggers and the addition tables are created.
Coordinator
Dec 17, 2013 at 2:03 PM
The solution is to install :
  1. the x64 version (x64 SDK Sync Framework 2.1)
  2. the redistributables of the x86 version x86 redistributables for Sync Framework 2.1 (Install the threee packages)
Sébastien
Dec 18, 2013 at 1:53 AM
I did everything but still giving the error

Error: Cannot obtain Metadata from http://localhost:51541/DefaultScopeSyncService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://localhost:51541/DefaultScopeSyncService.svc Metadata contains a reference that cannot be resolved: 'http://localhost:51541/DefaultScopeSyncService.svc'. The remote server returned an unexpected response: (400) Bad Request. The remote server returned an error: (400) Bad Request.HTTP GET Error URI: http://localhost:51541/DefaultScopeSyncService.svc The document at the url http://localhost:51541/DefaultScopeSyncService.svc/$syncscopes was not recognized as a known document type.The error message from each known type may help you fix the problem:- Report from 'XML Schema' is 'The root element of a W3C XML Schema should be <schema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'.- Report from 'DISCO Document' is 'Discovery document at the URL http://localhost:51541/DefaultScopeSyncService.svc/$syncscopes could not be found.'. - The document format is not recognized.- Report from 'WSDL Document' is 'There is an error in XML document (1, 2).'. - <service xmlns='http://www.w3.org/2007/app'> was not expected.
Coordinator
Dec 18, 2013 at 9:23 AM
Try to send me your project, I will test it on my own machine.
I need :
Your server project
Your client project
Your database already configured

You can send it to [spertus [@] microsoft [.] com]