2013-04-02 91 views
0

大家早上好,我不能顯示在瀏覽器

我有一個Web應用程序項目從WCF數據,我已經添加了一個XPO模型來檢索數據庫中的數據和我添加了一個web服務WCF(。 svc)發佈從xpo檢索的數據。問題是,當我瀏覽谷歌瀏覽器的web服務它表明我:

此頁面包含以下錯誤:

第2行的錯誤,在第2列:開始標記:無效的元素名稱 下面的渲染頁至第一個錯誤

,當我使用內部Web瀏覽器中它顯示我:

拉頁XML東北peut考績理由affichée 不可能D'afficher L'主菜XML連接utilisant拉葉形德式的XSL。 Corrigez l'erreur,puis cliquez sur le bouton Actualiser ouréessayezultérieurement。


沒有comidecéavec uncaractèrenon valide。 Erreur lors du traitement de la ressource

<%@ ServiceHost帶下劃線。

IM一組3人在工作,他們的數據顯示,沒有PORB即使我們有相同的代碼!

我使用II8,VS2010,SQL Server 2012的

我的繼承人.svc文件的內容:

命名空間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) { } 
} 

}

謝謝提前。

+0

plesae,發表您的services.svc文件 – evgenyl

回答

0

嘗試刪除空間<%@ _ HERE_IS_EXTRA_SPACE_ServiceHost。 。 。

+0

我試圖刪除空間,但沒有什麼區別,我檢查我的隊友的代碼,相同的代碼,同樣的錯誤,但他們的.svc文件發佈,沒有probem。 – user2233979

+0

您的SVC文件內容沒有顯示 – evgenyl

+0

我貼我的我的.svc文件.. – user2233979