用于接收(使用)数据源的 WCF 示例

发布于 2024-09-10 04:59:22 字数 792 浏览 3 评论 0原文

我能找到的所有示例 WCF feed 服务都是关于生成 feed 的。吃饲料怎么样?是否有人有关于可以接受 Atom 或 RSS 格式数据源的 WCF 服务(最好是 .net 4.0)的示例或讨论的链接?我不需要生成提要,我需要接受它,验证它,将数据粘贴到各种后端系统(DB、Solr、文件系统)中。通过接受,我并不是说我去调用一些返回 Atom 或 RSS 的服务,我需要让人们向我发布 Atom 或 RSS。

我目前正在考虑提供一个接受字符串的服务,然后将该字符串加载到一些联合对象中......但这看起来很笨拙。我真的很惊讶没有人需要这样做,这让我觉得我正在做一些奇怪的事情。

只接受添加、更新、删除而不接受获取的 WCF 数据服务(RESTful wcf)怎么样?我找不到这样的例子,而且如果我这样做的话,似乎我会打破一些主要的编码标准。

任何建议、链接、想法、替代设计都会有帮助。 谢谢, 肯·

回复:詹姆斯要求提供更多信息。我正在编写一项服务,允许将多个不同的数据集发布到其中。类似于 GoogleBase。数据的定义是松散的,但许多单独的字段是动态定义的。除了标准格式(Atom 和 RSS)和 1 或 2 个必填字段外,其余都是用户定义的。到目前为止我所做的是拥有一个接受 XElement 参数的服务。然后,我可以在运行时确定该 XElement 是 RSS、ATOM 还是 POX,然后进行相应的处理。我只是不确定 XElement 是否同时支持 SOAP、REST 和 CLR。我还想看看是否有更标准的方法可以做到这一点。如果发出数据源的服务(这是可用的主要示例)就像太阳,那么我正在编写黑洞等效项。这是一项数据黑洞服务,可帮助我们的合作伙伴让我们及时了解我们需要了解的任何数据更改。

All the example WCF feed services that I can find are all about generating a feed. What about consuming a feed? Does anyone have any links to examples, or discussions, on a WCF service (.net 4.0 preferably) that can accept an Atom or RSS formatted data feed? I don't need to generate the feed, I need to accept it, validate it, stick the data into a variety of back end systems (DB, Solr, file system). And by accept, I don't mean I go call some service that returns Atom or RSS, I need to let people Post Atom or RSS to me.

I'm currently looking at having a service that accepts a string, then loads that string into some Syndication objects...but that seems clunky. I'm really amazed that there is no one out there needing to do this, which makes me think I'm doing something hinky.

What about a WCF Data Service (RESTful wcf) that only accepts Add, Update, Delete and not Get. I can find no example of that, and it seems like I'd be breaking some major coding standard if I did it.

Any suggestions, links, ideas, alternate designs would be helpful.
Thanks,
Ken

Re: James' request for more info. I am writing a service that will allow multiple, different, data sets to be posted to it. Similar to GoogleBase. There is a loose definition of the data, but a lot of the individual fields are dynamically defined. Other than a standard format (Atom and RSS) and 1 or 2 required fields, the rest is user defined. What I've done so far is have a Service that accepts an XElement argument. I can then determine at runtime if that XElement is RSS, ATOM, or POX, then I process accordingly. I just wasn't sure if XElement is SOAP and REST and CLR friendly all at once. I was also trying to see if there were more standard ways of doing this. If a service that emits data feeds (this is the primary example available) is like a sun, I'm writing the black hole equivalent. It's a data black hole service to help our partners keep us up to date on any changes to their data that we need to be aware of.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贱人配狗天长地久 2024-09-17 04:59:22

不确定您是否仍在寻找答案,我希望不是:-)

我一直在寻找同样的东西。请查看下面的链接。它帮助了我,也可能对其他人有帮助。

http://blog.jschlesinger.net /2009/09/consume-rss-feed-with-wcf-rest-starter.html

虽然在上面的链接中作者使用了program.cs,但是可以在WCF服务方法中编写相同的代码并公开它。

Not sure if you are still looking for the answer, i hope not :-)

I was looking for the same thing. Please have a look at the link below. It helped me and it may help someone else also.

http://blog.jschlesinger.net/2009/09/consume-rss-feed-with-wcf-rest-starter.html

Although in the above link the author used program.cs but it is possible to write same code in the WCF service method and expose it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文