如何在自定义 WCF HTTP 绑定中存储标头信息
基本上,我想从与侦听套接字不同的源获取 HTTP 请求。 但是,由于提供的绑定不提供对此的支持,因此我目前正在构建自己的绑定。
我当前的绑定由 WebMessageEncoder 和自定义 TransportBindingElement 组成,它引用自定义 ChannelListener,该 ChannelListener 使用实现 IReplyChannel 接口的自定义通道。 ServiceModel 调用“receiveRequest”方法,该方法随后应返回 RequestContext。
但是,RequestContext 类仅包含一个 RequestMessage 属性,我应该将其放入 Message 对象中。 截至目前,我不确定将与 WebGet / WebInvoke 属性中的 UriTemplates 匹配所需的所有 HTTP 标头放在哪里。
你能帮我解决这个问题吗? :)
问候
Basically, I want to get HTTP requests from a different source than a listening socket. However, since the provided bindings don't offer support for this, I am currently building my own binding.
My current binding consists of the WebMessageEncoder and of a custom TransportBindingElement, which references a custom ChannelListener which uses a custom channel which implements the IReplyChannel interface. The ServiceModel invokes the "receiveRequest" method, which should afterwards return a RequestContext.
However, the RequestContext class only contains a RequestMessage property where I should put in the Message object. As of this fact, I'm not sure where to put all the HTTP headers which are needed to match on UriTemplates in WebGet / WebInvoke attributes.
Could you please help me with this one? :)
Greetings
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,WebHttp 调度程序关注两件事:
The WebHttp dispatcher looks at two things, from what I remember: