服务器页面(jsp、aspx)可以用作Web Service吗 [英] Can a server page (jsp, aspx) be used as Web Service

查看:37
本文介绍了服务器页面(jsp、aspx)可以用作Web Service吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Web 服务"和调用 JSP/ASPX 等服务器页面有什么区别?

What is the difference between using a "Web Service" and calling a server page such as JSP/ASPX?

在我看来,Web 服务只是一个围绕服务器页面的框架.例如我可以有一个 JSP 页面:

To me it looks like a Web Service is just a framework around the server pages. For e.g. I can have a JSP page that takes:

mypage.jsp?method=getupdate&param1=23&param=44(我也可以通过POST发送这些变量)

mypage.jsp?method=getupdate&param1=23&param=44 (I can also send these variables through POST)

在我的 JSP 页面中,我可以根据method"的值调用适当的方法并将值返回给调用方客户端应用程序.这是 Web 服务实际工作方式的原始形式吗?或者像有人告诉我的那样,Web 服务调用还有更多内容,当您调用页面时,它会呈现但 Web 服务不会呈现.但是如果我从 JSP 页面中删除 HTML 代码呢?

In my JSP page I can call the appropriate method based on the value of "method" and return a value back to the caller client app. Is this the raw form how a Web Service actually works? OR is there more to a Web Service call like someone told me that when you call a page, it is rendered but a Web Service is not rendered. But What if I remove the HTML code from JSP page then?

因此,当我们说 XML Web Service 时,区别在于客户端和服务器都使用 XML 包装/解包请求/响应并将其 POST 到 Web Service 页面.

So when we say XML Web Service, the difference is that the client and the server both wrap/unwrap the requests/responses using XML and POST it to the Web Service page.

推荐答案

Web 服务是一个明确定义的 一组标准 由 W3C 和其他相关机构定义,其中大部分是定义在网络上运行的架构,以在确保互操作性、可发现性和其他一些相关标准的同时,对不同的应用程序进行通信.

Web Services are a well defined set of standards defined by the W3C and other relevant bodies, which mostly define an architecture that runs over a network to communicate diverse applications while ensuring interoperability, discoverability and some other relevant criteria.

您当然可以为您的应用程序创建一个服务器页面,而无需 SOAP 或 XML-RPC.只是你不应该称它为Web 服务",除非它输出 SOAP 或 XML-RPC 并为自己提供 WSDL 描述,因为这会导致混淆并表明你不知道标准 Web 服务"是什么意思.

You can certainly create a server page just for your application without SOAP or XML-RPC. It's just that you shouldn't call it a "Web Service" unless it outputs SOAP or XML-RPC and provides a WSDL description for itself, because that leads to confusion and show you don't know what the "standard Web Services" mean.

这篇关于服务器页面(jsp、aspx)可以用作Web Service吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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