Messaging System in .net
We have a Message broker application in Java which accepts messages(XML). It validates the XML against XSD and calls a .net Webservice and passes the validated XML.
We have a requirement to do the same in .net. Do we have any API's to do this one. I am looking for a system that takes care of logging in case of errors or some kind of activity l开发者_如何学JAVAog. Is Windows workflow foundation meant to do this kind of task?
Any suggestions greatly appreciated.
Thanks
WWF could do this, but you'd probably be happier with just standard Windows Servic.
The XSD class from the System.XML namespace will provide validation, and just reference the webservice as a web-reference in your project for programmatic access to its methods.
You didn't explain how it was to receive/retrieve the messages but there's support for MSMQ as well as port polling.
Since you already have a Web Service, can I assume you're using WCF? WCF is a messaging system; see this guide on how to configure it to use MSMQ. This gives you all of the reliability of a well-tested messaging system without any of the overhead - message correlation, poison message handling, etc.
Most likely your architecture would look like:
Client ---> Validation Service ---> Business Service
Where the "Validation Service" is what we're talking about here, and what would be configured to use ReliableMessaging (using MSMQ).
Obviously you can have your WCF service do whatever logging you want. Personally, I'd suggest log4net, it's well-supported and takes away a lot of the tedium.
Maybe .Net System.Messaging namespace could help you?
Try this intro to MSMQ
Also using Linq to XML will make your XML processing really easy.
Validate the XML with LINQ to XML
If your are not familiar with LINQ to XML, take alook at this intro
精彩评论