本文介绍了[E2013] [MAPI-HTTP] [C#]:HttpRequest.InputStream在通过HTTP扩展的Exchange 2013 MAPI中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,所有

我正在尝试为Exchange 2013 SP1邮箱服务器上的Exchange Backend / mapi / emsmdb虚拟目录开发扩展。对于我的应用程序,我需要访问HttpRequest输入流,我们已经完成了OWA,EWS和RpcProxy的问题。

I'm trying to develop an extension for the Exchange Backend/mapi/emsmdb virtual directory on Exchange 2013 SP1 mailbox servers. For my application I need access to the HttpRequest input stream, something we've done without issues for OWA, EWS and RpcProxy.

然而,处理程序"Microsoft.Exchange.MapiHttpHandler"使用.Net 4.5中引入的System.Net.HttpRequest.GetBufferlessInputStream()方法,并禁用HttpRequest的输入流可扩展性。如果基于System.Web.IHttpModule
的扩展在PreRequestHandlerExecute或之前调用HttpRequest.InputStream,它会成功,但由于Method Not Supported异常,MapiHttpHandler会使请求失败。 如果扩展尝试在PostRequestHandlerExecute或之后调用InputStream,则
会抛出Method Not Supported异常。 输入流根本无法用于扩展。

However, the handler "Microsoft.Exchange.MapiHttpHandler" uses the System.Net.HttpRequest.GetBufferlessInputStream() method introduced in .Net 4.5, and that disables input stream extensibility for the HttpRequest. If an extension based on System.Web.IHttpModule invokes the HttpRequest.InputStream at or before PreRequestHandlerExecute, it succeeds but the MapiHttpHandler fails the request due to an Method Not Supported exception.  If the extension tries to invoke InputStream at or after PostRequestHandlerExecute, it throws an Method Not Supported exception.  The input stream is simply not available to the extension.

.Net 4.5.1中的WCF服务修复了此问题,请参阅
http://blogs.msdn.com/b/praburaj/archive/2012/09/13/accessing-httpcontext-current-request-inputstream -property合aspnetcompatibility模式抛出的异常此结果的方法或 - 属性-IS-未负载型后的HttpRequest-getbufferlessinputstream-过气 - invoked.aspx

我相信它是通过让处理程序捕获Method Not Supported异常并回退到经典输入流来完成的,如果扩展先前已通过调用InputStream设置了输入模式。

This problem was fixed for WCF services in .Net 4.5.1, see http://blogs.msdn.com/b/praburaj/archive/2012/09/13/accessing-httpcontext-current-request-inputstream-property-in-aspnetcompatibility-mode-throws-exception-this-method-or-property-is-not-supported-after-httprequest-getbufferlessinputstream-has-been-invoked.aspx. I believe it was done by having the handler catch the Method Not Supported exception and falling back to a classic input stream, if an extension has previously set the input mode by invoking the InputStream.

是否有可能通过这种方式修复MapiHttpHandler以实现可扩展性? 此类修复不会影响不运行使用此修复程序的第三方扩展的Exchange Server用户。很明显,修复是一个已知的数量,在另一个区域使用

Is there any possibility of fixing the MapiHttpHandler to allow extensibility in this way?  Such a fix would not affect Exchange Server users that do not run third-party extensions that make use of the fix. And clearly the fix is a known quantity, having been used in another area.

如果不这样做,我会对任何有关捕获和分析Mapi over Http请求和响应流的方法的想法非常感兴趣。

Failing that, I'd be very interested in any ideas for alternative approaches to capturing and analyzing the Mapi over Http request and response streams.

谢谢,

John Lowery

Thanks,
John Lowery

推荐答案


这篇关于[E2013] [MAPI-HTTP] [C#]:HttpRequest.InputStream在通过HTTP扩展的Exchange 2013 MAPI中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 15:38