我可以在SOAP服务中使用REST原则吗? [英] Can I use REST Principles in SOAP Services?

查看:73
本文介绍了我可以在SOAP服务中使用REST原则吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Experts,



非常早安。



我有一个网络应用程序,其中用户输入数据并将其存储在我的本地数据库(MySQL)中。我有一个由我的客户提供的SOAP Web服务。我听说REST是新的,非常可靠且易于理解。现在我的问题是我希望将REST原则与我的客户的SOAP Web服务一起使用,以将数据从MySQL传输到他们的Web服务。这里的任何人都可以帮助我理解如何开始吗?我读过有关REST原则及其工作原理的文章。但是以编程方式我不知道如何启动整个想法(我是Dotnet的新手)。

Hello Experts,

A very Good Morning.

I have a web application, where user enter the data and it is stored in my local database (MySQL). I have a SOAP Webservice provided by my customer. I heard REST is new and very reliable and easy to understand. Now my question is I want to use REST Principles with my Customer's SOAP webservices to transfer the data from MySQL to their webservice. Can anyone in here help me out in understanding how to start? I have read about REST Principles and how they work. But Programmatically I have no clue how to start the whole idea (I am new to Dotnet).

推荐答案

你可以在SOAP中使用REST原则,但是没有必要这样做。



SOAP提供了一种通过XML访问特定对象方法和属性的方法。 REST允许您根据您正在进行的请求的动词指定如何处理对象的方法或属性。



因此,您可以构建一个SOAP服务,说,这是一个将一些数据传递给给定对象的信封,但没有指定方法。相反,如果请求动词是PUT,则设置指定属性的值。如果是GET,则获取值该物业。



但这有点傻。在构建SOAP服务时,您已经在处理XML文档的开销。在另一个节点中,明确调用所需方法的危害是什么?



虽然,我想,如果你想成为超级用户,请确保你的客户请求正在调用正确的是,您可以检查请求动词并确保它与SOAP请求中的方法匹配。
You could use REST principles with SOAP, but there's no need to do so.

SOAP provides a means to access specific object methods and properties through XML. REST allows you to specify what to do with an object's methods or properties based on the verb of the request you're making.

So you could build a SOAP service that says, "Here is an envelope that passes some data to a given object, but does not specify a method. Instead, if the request verb is PUT, then set the value of the specified property. If it's GET, then get the value of the property." etc., etc.

But that's kinda silly. You're already encumbering the overhead of processing an XML document when you build a SOAP service. What's the harm in one more node, that explicitly calls the required method?

Although, I suppose, if you wanted to be super-duper sure your client requests are calling the right thing, you could check the request verb and make sure it matches the method in the SOAP request.


这篇关于我可以在SOAP服务中使用REST原则吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆