如何在ASP.Net中使用WebService实现MSMQ [英] How to implement MSMQ with WebService in ASP.Net
本文介绍了如何在ASP.Net中使用WebService实现MSMQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi Frnds,
任何人都可以帮我提供示例代码或步骤来实现webservice与MSMQ。
我已经在我的服务器上安装了msmq。
谢谢
Hi Frnds,
anyone can help me to provide sample code or Steps to implement webservice with MSMQ .
I have already installed msmq in my server .
Thanks
推荐答案
基本上你需要
1 - 排队请求的东西
2 - 读取队列并处理请求的东西。
1)将请求排入队列,您可以提供WCF服务,这样您就可以拥有一个使用该服务汇总请求的客户端。
2)要读取队列,您可以创建一个ServiceHost来继续等待给定队列上的新请求。
但请记住这是一种即发即弃的方法,所以当你把一些东西放入队列时,你就无法了解它。
如果您需要了解您的请求的状态,您需要一个带有2个队列的双向系统,事情变得有点复杂。
你可以在这里找到一份工作样本
使用MSMQ通信和证书安全性创建WCF服务 [ ^ ]
或者这里
wcf-and-msmq-第1部分/ [ ^ ]
再见
basically you need
1 - something that enqueues requests
2 - something that reads the queue and processes the requests.
1) to enqueue request you can make a WCF service, so you can have a "client" that sumbit request using that service.
2) to read the queue you can create a ServiceHost that keep waiting new requests on the given queue.
BUT keep in mind that is a "Fire and forget" approach, so when you put something in the queue you can't know anything about it.
if you need to get informed about your request's status you need a bidirectional system with 2 queue and things become a little more complex.
you can find a working sample here
Creating a WCF Service with MSMQ Communication and Certificate Security[^]
or here
wcf-and-msmq-part-1/[^]
bye
这篇关于如何在ASP.Net中使用WebService实现MSMQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文