WCF 审计/日志记录

发布于 2024-09-10 20:16:46 字数 575 浏览 3 评论 0原文

我需要在 WCF 服务中提供不可否认性,并且希望将所有传入的 SOAP 请求以及签名/安全数据和所有信封内容存储到 SQL Server 数据库中

这样,当出现问题时,我们可以告诉客户“嗨,这是您签名的消息与您所写的一模一样。 为此,我需要存储 SOAP 信封 XML 和我的持久业务对象/事务之间的关系。

示例:THIS 是用于将客户 ID=4567 添加到我的客户数据表的 SOAP 信封

我需要在 SOAP 信封和我的应用程序执行的业务事务之间建立链接。存储记录消息的@@identity 可能是一个解决方案。但是,我该把它放在哪里呢?在 SOAP 主体中?留在记忆中吗?

我读过有关 WCF 日志记录的内容,并编写了一个数据库记录器,它将日志信息而不是文本文件插入表中,但我不知道如何将此数据与解析/反序列化的业务数据契约链接起来到达我的 WCF 服务方法的对象。 我什至不知道这是否是正确的方法!

任何模式/提示/提示/工具/帮助将不胜感激。 谢谢。

I need to provide non repudiation in my WCF services and want to store all my incomming SOAP requests into a SQL server DB with signature/security data and all the envelope stuff.

This way, when a problem occurs, we can tell to the client "Hi, THIS is your signed message" exactly as you wrote it.
To do this, I need to store a relationship between the SOAP envelope XML's and my persisted bussiness objects/transactions.

Example: THIS is the SOAP Envelope used to add Customer ID=4567 to my Customers datables.

I need to establish a link between SOAP envelope and the bussiness transaction performed by my app. Storing @@identity of the logged message could be a solution. But, where do I put it? In the SOAP Body? Keep it in memmory?

I've reading about logging in WCF and wrote a Database Logger that inserts into tables the log info instead a text file, but i don't know how to link this data with the parsed/deserialized bussines datacontract object that arrives to my WCF service's method.
I don't even know if this is the rigth approach!

Any pattern/tip/hint/tool/help would be appreciated.
Thanks.

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

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

发布评论

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

评论(1

み青杉依旧 2024-09-17 20:16:46

如果您已启用 WCF 的消息日志记录功能 (http://msdn.microsoft .com/en-us/library/ms730064.aspx),您可以编写自定义侦听器,并在那里添加您需要的所有逻辑。要编写自定义侦听器,您只需实现 TraceListener 接口(相当简单),然后配置 WCF 来使用它,将其添加到 system.diagnostics 内的侦听器部分,替换默认侦听器。

If you have enabled the message logging feature of WCF (http://msdn.microsoft.com/en-us/library/ms730064.aspx), you can write a custom listener, and there add all the logic you need. To write a custom listener you only have to implement the TraceListener interface (fairly simple) and then configure WCF to use it, adding it to the listeners section inside the system.diagnostics, replacing the default listener.

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