题
我是wcf编程的新增功能和它的综合类别等。当有人试图访问我服务的根地址时,我正在编程以编程方式编程生产ATOMPUB服务文档。我只能在某种程度上在某种程度上使用Servicedocument,ResourceCollectionInfo,Workspace类 -
<service>
<app:workspace>
<a10:title type="text">Sample Repository</a10:title>
<app:collection href="http://some_url">
<a10:title type="text">Root Collection</a10:title>
</app:collection>
</app:workspace>
</service>
.
但是,我想添加一些自定义属性和元素,如下所示。请注意XMLNS属性,CMISRO元素等。
<service
xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:app="http://www.w3.org/2007/app"
xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
<workspace>
<atom:title>Sample Repository</atom:title>
<collection href="http://some_url">
<atom:title>Root Collection</atom:title>
<cmisra:collectionType>root</cmisra:collectionType>
</collection>
</workspace>
</service>
.
MSDN网站或其他地方没有任何可用的东西。关于如何实现这一目标的任何投入都将得到理解。
谢谢!
谢谢。
解决方案
The ResourceCollectionInfo
class has two properties ElementExtensions
and AttributeExtensions
which can be used to customize the serialization of a ResourceCollectionInfo
. Please note that most of the syndication elements have those extensions, which work with both the RSS and Atom formatters.
不隶属于 StackOverflow