微风元数据以xml格式显示 [英] Breeze Metadata appears in xml format
问题描述
微风无法创建实体。它查询元数据(在我的Controller类中),并返回带有200个代码的数据。然后,它查询数据,并返回200码。两组返回数据在表面上似乎都是json格式。
Breeze cannot create entities. It does the query for Metadata (which is in my Controller class) and it returns data with a 200 code. Then it queries the data, and returns with a 200 code. Both sets of return data appear to be json format on the surface.
再看一下Metadata,它似乎是json对xml元数据进行序列化。这对我来说并不正确-在微风站点上的实时示例中,似乎并没有这样做。
Looking further into the Metadata, it appears to be json serializing the xml metadata. This does not feel right to me - and on the live example on the breeze site, does not appear to be doing this.
任何人都对可能造成的原因有任何提示这个?元数据的开始方式如下:
Anyone have any tips on what might be causing this? Here is how the metadata starts:
"{\"?xml\":{\"version\":\"1.0\",\"encoding\":\"utf-8\"},\"schema\":{\"namespace\":
当服务返回数据时,我收到一个错误,其中包含完整的&正确的json响应。internalError报告无法获取未定义或空引用的属性'createCtor'
When the service returns data, I get an error, with the full & correct json response. The internalError reports "Unable to get property 'createCtor' of undefined or null reference"
当我调试了breeze.js:
It gets to this line in the mergeEntity function, when I debug breeze.js:
targetEntity = entityType._createEntityCore();
然后在ctr.prototype.getEntityCtor函数中-它无法使用此行从metadataStore的_typeRegistry属性获取实体的构造函数:
Then in the ctr.prototype.getEntityCtor function - it fails to get the entity's constructor from the metadataStore's _typeRegistry property using this line:
var aCtor = typeRegistry[this.name] || typeRegistry[this.shortName];
之后,将引发错误,最终导致executeQuery函数被捕获。
after that, the error is thrown and we end up in the catch of the executeQuery function.
推荐答案
我遇到的问题应该很明显。脚本更新后,我的捆绑配置不包括敲除脚本。如果遇到此问题,请确保已加载了绑定库(并且加载正确)。
The issue I was having should have been obvious. My bundling configuration was not including knockout scripts after the scripts have been updated. Be sure that you have a binding library loaded (and it's loading properly) if you experience this issue.
这篇关于微风元数据以xml格式显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!