Asp.net 我无法在浏览器中显示WCF中的数据
各位早上好, 我有一个web应用程序项目,我添加了一个xpo模型来从数据库检索数据,我添加了一个webservice WCF(.svc)来发布从xpo检索的数据。问题是,当我使用谷歌浏览器浏览Web服务时,它会显示: 此页面包含以下错误: 第2行第2列出错:StartTag:元素名称无效 下面是第一个错误之前的页面呈现 当我使用内部web浏览器时,它会显示: 这是一个很好的例子 不可能使用风格XSL的XML文档。Corrigez l'erreur,是bouton酒店的实施者Asp.net 我无法在浏览器中显示WCF中的数据,asp.net,xml,wcf,xpo,Asp.net,Xml,Wcf,Xpo,各位早上好, 我有一个web应用程序项目,我添加了一个xpo模型来从数据库检索数据,我添加了一个webservice WCF(.svc)来发布从xpo检索的数据。问题是,当我使用谷歌浏览器浏览Web服务时,它会显示: 此页面包含以下错误: 第2行第2列出错:StartTag:元素名称无效 下面是第一个错误之前的页面呈现 当我使用内部web浏览器时,它会显示: 这是一个很好的例子 不可能使用风格XSL的XML文档。Corrigez l'erreur,是bouton酒店的实施者 不合法的共同财产。
不合法的共同财产。你的名字是什么
请尝试删除空间,发布你的服务.svc文件我尝试删除空间,但没有区别,我检查了我的队友代码,相同的代码,相同的错误,但他们的.svc文件发布时没有问题。由于此代码在你的同事电脑上工作,我认为问题在于防御。我指的是您的webservice WCF(.svc)文件,而不是实现。仔细检查要打开/关闭/格式化的标签。
[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) { }
}