问题描述
我们在以下网址上收到此错误(帖子末尾的完全例外):
$
http:// localhost:2948 / FourWerkService .svc / EreignisSet(6)?$ expand = PersonEreignis / Person / PersonGrad / Grad
一旦我们将Grad展开,它就会起作用:
http:// localhost:2948 / FourWerkService.svc / EreignisSet(6)?$ expand = PersonEreignis / Person / PersonGrad
模型如下:
[Ereignis] 1 --- n [PersonEreignis] n --- 1 [Person] 1 --- n [ PersonGrad] n --- 1 [Grad]
在这种情况下,[Ereignis]只有一个[PersonEreignis],因此只有一个[Person],没有[PersonGrad]因此任何[Grad]
这个网址没有问题:
http:/ /localhost:2948/FourWerkService.svc/PersonSet(418)?$ expand = PersonGrad / Grad
它有什么问题?应该在网址中指定其他内容吗?那是一个错误吗?有没有解决方法?
提前致谢
完全例外:
<?xml版本= QUOT; 1.0"编码= QUOT; ISO-8859-1" standalone =" yes"?>
< entry xml:base =" http:// localhost:2948 / FourWerkService.svc /"的xmlns:d =" HTTP://schemas.microsoft.com/ado/2007/08/dataservices"的xmlns:M =" HTTP://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns =" http://www.w3.org/2005/Atom">
< id> http:// localhost:2948 / FourWerkService.svc / EreignisSet(6)< / id>
< title type =" text">< / title>
< updated> 2010-04-20T08:59:24Z< / updated>
< author>
< name />
< / author>
< link rel =" edit"标题= QUOT;本生" HREF =" EreignisSet(6)" />
< link rel =" http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonEreignis"类型= QUOT;应用/原子+ xml的;类型=进料"标题= QUOT; PersonEreignis" href =" EreignisSet(6)/ PersonEreignis"> b
< m:inline>
< feed>
< title type =" text"> PersonEreignis< / title>
< id> http:// localhost:2948 / FourWerkService.svc / EreignisSet(6)/ PersonEreignis< / id>
< updated> 2010-04-20T08:59:24Z< / updated>
< link rel =" self"标题= QUOT; PersonEreignis" HREF =" EreignisSet(6)/ PersonEreignis" />
$
< entry>
< ID> HTTP://本地主机:2948 / FourWerkService.svc / PersonEreignisSet(32)< / ID>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ; < title type =" text">< / title>
< updated> 2010-04-20T08:59:24Z< / updated>
< author>&
< name />
< / author>
< link rel =" edit"标题= QUOT; PersonEreignis" HREF =" PersonEreignisSet(32)>>; />
$
< link rel =" http://schemas.microsoft.com/ado/2007/08/dataservices/related/Ereignis"类型= QUOT;应用/原子+ xml的;类型=项"标题= QUOT;本生" HREF =" PersonEreignisSet(32)/&本生QUOT;
/>
< link rel =" http://schemas.microsoft.com/ado/2007/08/dataservices/related/Person"类型= QUOT;应用/原子+ xml的;类型=项"标题= QUOT;人" href =" PersonEreignisSet(32)/ Person">
< m:inline>
< entry>&
< ID> HTTP://本地主机:2948 / FourWerkService.svc / PersonSet(418)< / ID>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; <标题类型= QUOT;文本">< /标题>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP; <更新> 2010-04-20T08:59:24Z< /更新>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP; <作者>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < name />&
< / author>&
< link rel =" edit"标题= QUOT;人" HREF =" PersonSet(418)" /> < link rel =" http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonEreignis"类型= QUOT;应用/原子+ xml的;类型=进料"标题= QUOT; PersonEreignis"
href =" PersonSet(418)/ PersonEreignis" /> < link rel =" http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonAusbildung"类型= QUOT;应用/原子+ xml的;类型=进料"标题= QUOT; PersonAusbildung"
href =" PersonSet(418)/ PersonAusbildung" /> < link rel =" http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonAusweiskategorie"类型= QUOT;应用/原子+ xml的;类型=进料"标题= QUOT; PersonAusweiskategorie"
href =" PersonSet(418)/ PersonAusweiskategorie" /> < link rel =" http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonFeuerwache"类型= QUOT;应用/原子+ xml的;类型=进料"标题= QUOT; PersonFeuerwache"
href =" PersonSet(418)/ PersonFeuerwache" /> < link rel =" http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonFunktion"类型= QUOT;应用/原子+ xml的;类型=进料"标题= QUOT; PersonFunktion"
href =" PersonSet(418)/ PersonFunktion" /> < link rel =" http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonGrad"类型= QUOT;应用/原子+ xml的;类型=进料"标题= QUOT; PersonGrad"
HREF =" PersonSet(418)/ PersonGrad">
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP; < M:直列>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP; <饲料>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP; < title type =" text"> PersonGrad< / title>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < id> http:// localhost:2948 / FourWerkService.svc / PersonSet(418)/ PersonGrad< / id>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; <更新> 2010-04-20T08:59:24Z< /更新>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < link rel =" self"标题= QUOT; PersonGrad" HREF =" PersonSet(418)/ PersonGrad" />
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP; < m:错误> &NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < M:码>< / M:码>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < m:message xml:lang =" de-CH">处理此请求时出错。< / m:message>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < innererror的xmlns = QUOT; XMLNS">
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < message>对象引用未设置为对象的实例。< / message>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; <类型> System.NullReferenceException< /类型>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; <堆栈跟踪>&NBSP;&NBSP;在System.Data.Services.Serializers.SyndicationSerializer.WriteOtherElements(字符串
标题,字符串linkRelation,乌里绝对URI,字符串relativeUri,SyndicationItem项)及#xD;
&NBSP;&NBSP;在System.Data.Services.Serializers.SyndicationSerializer.WriteEntryElement(IExpandedResult扩大,对象元素,类型expectedType,乌里绝对URI,字符串relativeUri,SyndicationItem靶)及#xD;
&NBSP;&NBSP;在System.Data.Services.Serializers.SyndicationSerializer。& lt; DeferredFeedItems& gt; d__0.MoveNext()& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItems(XmlWriter writer,IEnumerable`1 items,Uri feedBaseUri)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteFeedTo(XmlWriter writer,SyndicationFeed feed,Boolean isSourceFeed)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteFeed(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteTo(XmlWriter writer)& #xD;
在System.Data.Services.Serializers.SyndicationSerializer.InlineAtomFeed.WriteXml(XmlWriter writer)& #xD;
在System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteIXmlSerializable(XmlWriterDelegator的XmlWriter,对象OBJ,XmlSerializableWriter xmlSerializableWriter)及#xD;
&NBSP;&NBSP;在System.Runtime.Serialization.XmlDataContract.WriteXmlValue(XmlWriterDelegator的XmlWriter,对象OBJ,XmlObjectSerializerWriteContext上下文)及#xD;
&NBSP;&NBSP;在System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer,Object graph)& #xD;
在System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer,Object graph)& #xD;
在System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer,Object graph)& #xD;
在System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer,Object graph)& #xD;
在System.ServiceModel.Syndication.SyndicationElementExtension.ExtensionDataWriter.WriteTo(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.SyndicationElementExtension.WriteTo(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.SyndicationElementExtensionCollection.WriteTo(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.ExtensibleSyndicationObject.WriteElementExtensions(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.SyndicationLink.WriteElementExtensions(XmlWriter writer,String version)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteLink(XmlWriter writer,SyndicationLink link,Uri baseUri)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItemContents(XmlWriter dictWriter,SyndicationItem item,Uri feedBaseUri)& #xD;
在System.ServiceModel.Syndication.Atom10ItemFormatter.WriteItem(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.Atom10ItemFormatter.WriteTo(XmlWriter writer)& #xD;
在System.Data.Services.Serializers.SyndicationSerializer.InlineAtomItem.WriteXml(XmlWriter writer)& #xD;
在System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteIXmlSerializable(XmlWriterDelegator的XmlWriter,对象OBJ,XmlSerializableWriter xmlSerializableWriter)及#xD;
&NBSP;&NBSP;在System.Runtime.Serialization.XmlDataContract.WriteXmlValue(XmlWriterDelegator的XmlWriter,对象OBJ,XmlObjectSerializerWriteContext上下文)及#xD;
&NBSP;&NBSP;在System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer,Object graph)& #xD;
在System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer,Object graph)& #xD;
在System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer,Object graph)& #xD;
在System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer,Object graph)& #xD;
在System.ServiceModel.Syndication.SyndicationElementExtension.ExtensionDataWriter.WriteTo(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.SyndicationElementExtension.WriteTo(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.SyndicationElementExtensionCollection.WriteTo(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.ExtensibleSyndicationObject.WriteElementExtensions(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.SyndicationLink.WriteElementExtensions(XmlWriter writer,String version)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteLink(XmlWriter writer,SyndicationLink link,Uri baseUri)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItemContents(XmlWriter dictWriter,SyndicationItem item,Uri feedBaseUri)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItem(XmlWriter writer,SyndicationItem item,Uri feedBaseUri)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItems(XmlWriter的作家,IEnumerable`1项目,乌里feedBaseUri)及#xD;
&NBSP;&NBSP;在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteFeedTo(XmlWriter的作家,SyndicationFeed饲料,布尔isSourceFeed)及#xD;
&NBSP;&NBSP;在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteFeed(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteTo(XmlWriter writer)& #xD;
在System.Data.Services.Serializers.SyndicationSerializer.InlineAtomFeed.WriteXml(XmlWriter writer)& #xD;
在System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteIXmlSerializable(XmlWriterDelegator的XmlWriter,对象OBJ,XmlSerializableWriter xmlSerializableWriter)及#xD;
&NBSP;&NBSP;在System.Runtime.Serialization.XmlDataContract.WriteXmlValue(XmlWriterDelegator的XmlWriter,对象OBJ,XmlObjectSerializerWriteContext上下文)及#xD;
&NBSP;&NBSP;在System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer,Object graph)& #xD;
在System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer,Object graph)& #xD;
在System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer,Object graph)& #xD;
在System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer,Object graph)& #xD;
在System.ServiceModel.Syndication.SyndicationElementExtension.ExtensionDataWriter.WriteTo(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.SyndicationElementExtension.WriteTo(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.SyndicationElementExtensionCollection.WriteTo(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.ExtensibleSyndicationObject.WriteElementExtensions(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.SyndicationLink.WriteElementExtensions(XmlWriter writer,String version)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteLink(XmlWriter writer,SyndicationLink link,Uri baseUri)& #xD;
在System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItemContents(XmlWriter dictWriter,SyndicationItem item,Uri feedBaseUri)& #xD;
在System.ServiceModel.Syndication.Atom10ItemFormatter.WriteItem(XmlWriter writer)& #xD;
在System.ServiceModel.Syndication.Atom10ItemFormatter.WriteTo(XmlWriter writer)& #xD;
在System.Data.Services.Serializers.SyndicationSerializer.WriteTopLevelElement(扩展的IExpandedResult,对象元素)& #xD;
在System.Data.Services.Serializers.Serializer.WriteRequest(IEnumerator queryResults,Boolean hasMoved)& #xD;
在System.Data.Services.ResponseBodyWriter.Write(流流)LT /堆栈跟踪>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < / innererror>
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP; < / m:错误>
We receive this error (full exception at the end of the post) on the following url:
http://localhost:2948/FourWerkService.svc/EreignisSet(6)?$expand=PersonEreignis/Person/PersonGrad/Grad
As soon as we take the Grad expand away it works:
http://localhost:2948/FourWerkService.svc/EreignisSet(6)?$expand=PersonEreignis/Person/PersonGrad
The model is as follow:
[Ereignis] 1---n [PersonEreignis] n---1 [Person] 1---n [PersonGrad] n---1 [Grad]
In this case the [Ereignis] has only one [PersonEreignis], therefore only one [Person], who has no [PersonGrad] and therefore any [Grad]
This url gives no problem:
http://localhost:2948/FourWerkService.svc/PersonSet(418)?$expand=PersonGrad/Grad
What is wrong with it? Should something else specified in the url? Is that a bug? Is there a work around?
Thanks in advance
Full exception:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<entry xml:base="http://localhost:2948/FourWerkService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<id>http://localhost:2948/FourWerkService.svc/EreignisSet(6)</id>
<title type="text"></title>
<updated>2010-04-20T08:59:24Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Ereignis" href="EreignisSet(6)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonEreignis" type="application/atom+xml;type=feed" title="PersonEreignis" href="EreignisSet(6)/PersonEreignis">
<m:inline>
<feed>
<title type="text">PersonEreignis</title>
<id>http://localhost:2948/FourWerkService.svc/EreignisSet(6)/PersonEreignis</id>
<updated>2010-04-20T08:59:24Z</updated>
<link rel="self" title="PersonEreignis" href="EreignisSet(6)/PersonEreignis" />
<entry>
<id>http://localhost:2948/FourWerkService.svc/PersonEreignisSet(32)</id>
<title type="text"></title>
<updated>2010-04-20T08:59:24Z</updated>
<author>
<name />
</author>
<link rel="edit" title="PersonEreignis" href="PersonEreignisSet(32)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Ereignis" type="application/atom+xml;type=entry" title="Ereignis" href="PersonEreignisSet(32)/Ereignis" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Person" type="application/atom+xml;type=entry" title="Person" href="PersonEreignisSet(32)/Person">
<m:inline>
<entry>
<id>http://localhost:2948/FourWerkService.svc/PersonSet(418)</id>
<title type="text"></title>
<updated>2010-04-20T08:59:24Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Person" href="PersonSet(418)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonEreignis" type="application/atom+xml;type=feed" title="PersonEreignis" href="PersonSet(418)/PersonEreignis" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonAusbildung" type="application/atom+xml;type=feed" title="PersonAusbildung" href="PersonSet(418)/PersonAusbildung" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonAusweiskategorie" type="application/atom+xml;type=feed" title="PersonAusweiskategorie" href="PersonSet(418)/PersonAusweiskategorie" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonFeuerwache" type="application/atom+xml;type=feed" title="PersonFeuerwache" href="PersonSet(418)/PersonFeuerwache" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonFunktion" type="application/atom+xml;type=feed" title="PersonFunktion" href="PersonSet(418)/PersonFunktion" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PersonGrad" type="application/atom+xml;type=feed" title="PersonGrad" href="PersonSet(418)/PersonGrad">
<m:inline>
<feed>
<title type="text">PersonGrad</title>
<id>http://localhost:2948/FourWerkService.svc/PersonSet(418)/PersonGrad</id>
<updated>2010-04-20T08:59:24Z</updated>
<link rel="self" title="PersonGrad" href="PersonSet(418)/PersonGrad" />
<m:error>
<m:code></m:code>
<m:message xml:lang="de-CH">An error occurred while processing this request.</m:message>
<innererror xmlns="xmlns">
<message>Object reference not set to an instance of an object.</message>
<type>System.NullReferenceException</type>
<stacktrace> at System.Data.Services.Serializers.SyndicationSerializer.WriteOtherElements(String title, String linkRelation, Uri absoluteUri, String relativeUri, SyndicationItem item)
at System.Data.Services.Serializers.SyndicationSerializer.WriteEntryElement(IExpandedResult expanded, Object element, Type expectedType, Uri absoluteUri, String relativeUri, SyndicationItem target)
at System.Data.Services.Serializers.SyndicationSerializer.<DeferredFeedItems>d__0.MoveNext()
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItems(XmlWriter writer, IEnumerable`1 items, Uri feedBaseUri)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteFeedTo(XmlWriter writer, SyndicationFeed feed, Boolean isSourceFeed)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteFeed(XmlWriter writer)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteTo(XmlWriter writer)
at System.Data.Services.Serializers.SyndicationSerializer.InlineAtomFeed.WriteXml(XmlWriter writer)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteIXmlSerializable(XmlWriterDelegator xmlWriter, Object obj, XmlSerializableWriter xmlSerializableWriter)
at System.Runtime.Serialization.XmlDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer, Object graph)
at System.ServiceModel.Syndication.SyndicationElementExtension.ExtensionDataWriter.WriteTo(XmlWriter writer)
at System.ServiceModel.Syndication.SyndicationElementExtension.WriteTo(XmlWriter writer)
at System.ServiceModel.Syndication.SyndicationElementExtensionCollection.WriteTo(XmlWriter writer)
at System.ServiceModel.Syndication.ExtensibleSyndicationObject.WriteElementExtensions(XmlWriter writer)
at System.ServiceModel.Syndication.SyndicationLink.WriteElementExtensions(XmlWriter writer, String version)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteLink(XmlWriter writer, SyndicationLink link, Uri baseUri)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItemContents(XmlWriter dictWriter, SyndicationItem item, Uri feedBaseUri)
at System.ServiceModel.Syndication.Atom10ItemFormatter.WriteItem(XmlWriter writer)
at System.ServiceModel.Syndication.Atom10ItemFormatter.WriteTo(XmlWriter writer)
at System.Data.Services.Serializers.SyndicationSerializer.InlineAtomItem.WriteXml(XmlWriter writer)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteIXmlSerializable(XmlWriterDelegator xmlWriter, Object obj, XmlSerializableWriter xmlSerializableWriter)
at System.Runtime.Serialization.XmlDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer, Object graph)
at System.ServiceModel.Syndication.SyndicationElementExtension.ExtensionDataWriter.WriteTo(XmlWriter writer)
at System.ServiceModel.Syndication.SyndicationElementExtension.WriteTo(XmlWriter writer)
at System.ServiceModel.Syndication.SyndicationElementExtensionCollection.WriteTo(XmlWriter writer)
at System.ServiceModel.Syndication.ExtensibleSyndicationObject.WriteElementExtensions(XmlWriter writer)
at System.ServiceModel.Syndication.SyndicationLink.WriteElementExtensions(XmlWriter writer, String version)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteLink(XmlWriter writer, SyndicationLink link, Uri baseUri)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItemContents(XmlWriter dictWriter, SyndicationItem item, Uri feedBaseUri)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItem(XmlWriter writer, SyndicationItem item, Uri feedBaseUri)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItems(XmlWriter writer, IEnumerable`1 items, Uri feedBaseUri)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteFeedTo(XmlWriter writer, SyndicationFeed feed, Boolean isSourceFeed)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteFeed(XmlWriter writer)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteTo(XmlWriter writer)
at System.Data.Services.Serializers.SyndicationSerializer.InlineAtomFeed.WriteXml(XmlWriter writer)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteIXmlSerializable(XmlWriterDelegator xmlWriter, Object obj, XmlSerializableWriter xmlSerializableWriter)
at System.Runtime.Serialization.XmlDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.DataContractSerializer.WriteObject(XmlWriter writer, Object graph)
at System.ServiceModel.Syndication.SyndicationElementExtension.ExtensionDataWriter.WriteTo(XmlWriter writer)
at System.ServiceModel.Syndication.SyndicationElementExtension.WriteTo(XmlWriter writer)
at System.ServiceModel.Syndication.SyndicationElementExtensionCollection.WriteTo(XmlWriter writer)
at System.ServiceModel.Syndication.ExtensibleSyndicationObject.WriteElementExtensions(XmlWriter writer)
at System.ServiceModel.Syndication.SyndicationLink.WriteElementExtensions(XmlWriter writer, String version)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteLink(XmlWriter writer, SyndicationLink link, Uri baseUri)
at System.ServiceModel.Syndication.Atom10FeedFormatter.WriteItemContents(XmlWriter dictWriter, SyndicationItem item, Uri feedBaseUri)
at System.ServiceModel.Syndication.Atom10ItemFormatter.WriteItem(XmlWriter writer)
at System.ServiceModel.Syndication.Atom10ItemFormatter.WriteTo(XmlWriter writer)
at System.Data.Services.Serializers.SyndicationSerializer.WriteTopLevelElement(IExpandedResult expanded, Object element)
at System.Data.Services.Serializers.Serializer.WriteRequest(IEnumerator queryResults, Boolean hasMoved)
at System.Data.Services.ResponseBodyWriter.Write(Stream stream)</stacktrace>
</innererror>
</m:error>
这篇关于“对象引用未设置为对象的实例” SyndicationSerializer中的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!