WCF类的扩展 [英] Extension of WCF-classes

查看:44
本文介绍了WCF类的扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Web服务的客户端应用程序,我们具有以下要求:

For the client-application of a webservice we have the following requirements:

  • 具有WCF的客户端
  • 对SOAP消息进行签名和加密
  • 应该记录传出消息.消息处于状态时,必须进行日志记录 签名未加密.
  • Client with WCF
  • SOAP-messages are signed and encrypted
  • The outgoing message should be logged. The logging must take place when the message is in the state signed and NOT encrypted.

我们想使用AsymmetricSecurityBindingElement作为基础.

We would like to use the AsymmetricSecurityBindingElement as base.

问题:

没有配置,您只能只能加密.

There is no configuration where you can only encrypt. 

不幸的是,由于AsymmetricSecurityBindingElement被标记为密封",因此也无法从AsymmetricSecurityBindingElement继承.

Unfortunately it is also not possible to inherit from AsymmetricSecurityBindingElement, as AsymmetricSecurityBindingElement is marked as "sealed".

 

问题:

如何获取"EncryptOnlyBindingElement"?没有从一开始就实现所有功能?

How do I get a "EncryptOnlyBindingElement" without implementing all the stuff from the beginning?

实际上,所有这些都将在WCF中准备就绪-但相关的类在运行时标记为密封".或内部" :-(

Actually all would be ready in WCF - but the relevant classes are marked "sealed" or "internal" :-(

 

该问题仅考虑客户.该Web服务是与Java相同的东西,可以视为黑盒.

The question considers only the client. The webservice is same Java stuff an can be considered as blackbox.

 

我们想重点关注这样的解决方案:

We would like to focus a solution like this:

 

Ext_AsymmetricSecurityBindingElement类:AsymmetricSecurityBindingElement

class Ext_AsymmetricSecurityBindingElement : AsymmetricSecurityBindingElement

{    }

{     }

 

Ext_AsymmetricSecurityProtocolFactory类:AsymmetricSecurityProtocolFactory

class Ext_AsymmetricSecurityProtocolFactory  : AsymmetricSecurityProtocolFactory

{    }

{     }

 

Ext_AsymmetricSecurityProtocol类:AsymmetricSecurityProtocol

class Ext_AsymmetricSecurityProtocol  : AsymmetricSecurityProtocol

{   }

{   }

 

Ext_SendSecurityHeader类:SendSecurityHeader

class Ext_SendSecurityHeader  : SendSecurityHeader

{    }

{     }

 

Ext_SecurityAppliedMessage类:SecurityAppliedMessage

class Ext_SecurityAppliedMessage : SecurityAppliedMessage

{   }

{   }

 

 

推荐答案

使用加密和签名.然后在自定义编码器中(或实际在任何地方)从邮件中手动删除签名.
use encrypt and sign. then in a custom encoder (or anywhere actually) manually remove the signature from the message.


这篇关于WCF类的扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆