开发者

Remote XML Web services using C#

I have been tasked with creating a Remote Web service. I am asking this question to get the best approach to what I need to accomplish and see if there is code examples out there that might help.

Task

Create a web service that accepts parameters when on button click of other programs. One is a windows app d开发者_如何学编程one in C# and the app is old fortran as400 app. I need to create this web service to acept these parameters coming from the other systems and then in the web services I need to take these parameters and send them to a Stored procedure and with the results create an XML file and post it back to the clients end.

Is this possible and if it is can someone point me to where I can see some examples or provide some help.


The de-facto standard today of creating web services in .NET is WCF.


Web service is not a fixed and well defined technology, so you have different options. The most common ones are SOAP and REST. In my opinion SOAP is to bloated and makes only sense in certain situations. Otherwise REST is the first choice. You can get a first overview of REST at http://en.wikipedia.org/wiki/Representational_State_Transfer. One big benefit of REST is that it's just HTTP. So compared to using SOAP it's much more likely that you have the required libraries available.

In .Net you can implement REST services in different ways. As Darin mentioned, WCF is one choice. But it's also possible using Asp.Net MVC. MVC is much simpler but still flexible and powerful in my opinion. If you are an WCF expert (unlikely when asking this question), go for it. If not, I'll go for MVC. You can learn more about MVC at http://www.asp.net/mvc. Just ask Google for "Asp.Net MVC Rest" and you'll get some hints how to combine both.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜