0

Good morning everyone,

I have a web application project, i've added an xpo model to retrieve data from database and i've added a webservice WCF ( .svc ) to publish data retrieved from the xpo. the problem is when i browse the webservice with google chrome it shows me:

This page contains the following errors:

error on line 2 at column 2: StartTag: invalid element name Below is a rendering of the page up to the first error

and when i use internal web browser it shows me:

La page XML ne peut pas être affichée Impossible d'afficher l'entrée XML en utilisant la feuille de style XSL. Corrigez l'erreur, puis cliquez sur le bouton Actualiser ou réessayez ultérieurement.


Nom commencé avec un caractère non valide. Erreur lors du traitement de la ressource

<%@ ServiceHost is underlined.

im working in a group of 3 persons and their data is shown with no porb even we have the same code!

i'm using II8, VS2010, SQL SERVER 2012

heres the content of my .svc file:

namespace DxWCF {

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
public class MyWCF : XpoDataServiceV3
{

    public MyWCF() : base(new MyContext("XpoContext", "BaseWCF", CreateDataLayer())) { }
    static IDataLayer CreateDataLayer()
    {
        ConnectionStringSettings mySetting = ConfigurationManager.ConnectionStrings["myconn"];
        if (mySetting == null || string.IsNullOrEmpty(mySetting.ConnectionString))
            throw new Exception("Fatal error: missing connecting string in web.config file");
        string myconn = mySetting.ConnectionString;

        DevExpress.Xpo.Metadata.XPDictionary dict = new DevExpress.Xpo.Metadata.ReflectionDictionary();
        // Initialize the XPO dictionary. 
        dict.GetDataStoreSchema(typeof(Users).Assembly);
        IDataStore store = XpoDefault.GetConnectionProvider(myconn, DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists);
        return new ThreadSafeDataLayer(dict, store);
    }
    public static void InitializeService(DataServiceConfiguration config)
    {
        config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
        config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
        config.DataServiceBehavior.AcceptProjectionRequests = true;
    }
}
public class MyContext : XpoContext
{
    public MyContext(string containerName, string namespaceName, IDataLayer dataLayer)
        : base(containerName, namespaceName, dataLayer) { }
}

}

Thanks in advance.

Soufiane N
  • 113
  • 1
  • 11

1 Answers1

0

Try to remove space <%@_HERE_IS_EXTRA_SPACE_ServiceHost . . .

evgenyl
  • 7,837
  • 2
  • 27
  • 32
  • I tried to remove space but no difference, i check my mates code, same code, same errors but their .svc file is published with no probem. – Soufiane N Apr 02 '13 at 11:40
  • Since this code works on your collegs pcs, i think the issue is in defenitions. I mean your webservice WCF ( .svc ) file, not implmentation. Review its tags to be opened / closed / formated well. – evgenyl Apr 02 '13 at 13:23