WCF 服务器在继续之前等待返回
这就是我想做的。
1.WCF中托管的服务
2. 客户端调用请求消息负载
3. 服务返回消息负载并等待客户端响应
3.A.客户端返回 200(OK)状态或确认收到消息的内容。
3.B.客户端返回错误状态,指出不删除服务器上的消息。
4. 根据 3.A 或 3.B,服务将采取适当的措施。
我想通过扩展 IDispatcher 和编写扩展方法来做到这一点。 VS 创建另一个服务并让客户端调用该服务来指示它收到了哪些消息。除非那是最佳实践。
提前致谢。
Here is what I would like to do.
1. Service hosted in WCF
2. Client calls asking for a payload of messages
3. Service returns payload of messages and waits for client to respond
3.A. Client returns 200 (OK) status or something confirming messages received.
3.B. Client returns bad error status stating to not delete the messages on server.
4. Depending on 3.A or 3.B Service will take appropriate action.
I would like to do this by doing something like extending IDispatcher and writing extension methods. VS creating another service and having the client call that service to signal which messages it received. Unless that's best practices.
Thanks in advanced.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果需要对 HTTP 状态代码进行操作,那么 WCF 可能不是您想要使用的。 WCF 的创建是为了能够编写与传输无关的代码,因此可以纯粹通过配置来更改绑定;无需更改代码。 HTTP 请求处理深深地埋藏在基于 HTTP 的绑定中,因此您最好使用 OpenRasta 框架之类的东西 来实现您的 HTTP (REST) 风格服务。它是一个非常了解 HTTP 请求的框架。
否则,请查看wsDualHttpBinding 简介通过应用程序 API 级别完成类似的事情。
If acting on HTTP status codes is a requirement then WCF is probably not what you want to use. WCF was created to be able to write transport independent code so the bindings could be changed purely through configuration; no code changes required. The HTTP request handling is buried so deeply into HTTP-based bindings that you're better off using something like the OpenRasta framework to implement your HTTP (REST) style service. It is a very HTTP request aware framework.
Otherwise, look at this wsDualHttpBinding intro to accomplish something similar through the application API level.