简体   繁体   English

WCF IDispatchMessageInspector

[英]WCF IDispatchMessageInspector

There is a message in the form of a string line that passes all tests. 有一条消息以字符串行的形式传递所有测试。 When trying to create out of it and return a message via BeforeSendReply, then flies the signature and the message will not validly. 当尝试创建它并通过BeforeSendReply返回消息时,则飞签名并且消息将无效。 What could be the reason? 可能是什么原因?

How can I create Message from string ? 如何从字符串创建消息?

You can get the message this way: 你可以这样得到消息:

public void BeforeSendReply(ref Message reply, object correlationState)
    {
            MessageBuffer buffer = reply.CreateBufferedCopy(Int32.MaxValue);
            reply = buffer.CreateMessage();
            string message = buffer.CreateMessage();
            ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM