假设我的web服务位于http://localhost:8080/foo/mywebservice, WSDL位于http://localhost:8080/foo/mywebservice?wsdl。

http://localhost:8080/foo/mywebservice是否是端点,即,它是否与我的web服务的URI相同,或者SOAP消息在接收和解组的地方相同?

你能给我解释一下它是什么,它的目的是什么吗?


更新的答案,来自Peter的评论:

这是“旧术语”,直接使用wsdl“端点” 定义(WSDL2将“端口”转换为“端点”)。


也许您可以在本文档中找到答案:http://www.w3.org/TR/wsdl.html

A WSDL document defines services as collections of network endpoints, or ports. In WSDL, the abstract definition of endpoints and messages is separated from their concrete network deployment or data format bindings. This allows the reuse of abstract definitions: messages, which are abstract descriptions of the data being exchanged, and port types which are abstract collections of operations. The concrete protocol and data format specifications for a particular port type constitutes a reusable binding. A port is defined by associating a network address with a reusable binding, and a collection of ports define a service. Hence, a WSDL document uses the following elements in the definition of network services: Types– a container for data type definitions using some type system (such as XSD). Message– an abstract, typed definition of the data being communicated. Operation– an abstract description of an action supported by the service. Port Type–an abstract set of operations supported by one or more endpoints. Binding– a concrete protocol and data format specification for a particular port type. Port– a single endpoint defined as a combination of a binding and a network address. Service– a collection of related endpoints.

http://www.ehow.com/info_12212371_definition-service-endpoint.html

The endpoint is a connection point where HTML files or active server pages are exposed. Endpoints provide information needed to address a Web service endpoint. The endpoint provides a reference or specification that is used to define a group or family of message addressing properties and give end-to-end message characteristics, such as references for the source and destination of endpoints, and the identity of messages to allow for uniform addressing of "independent" messages. The endpoint can be a PC, PDA, or point-of-sale terminal.

这是一个更简短、更清晰的答案…… 是的,端点是客户端应用程序可以访问您的服务的URL。相同的web服务可以有多个端点,例如,为了使用不同的协议使其可用。

在我过去参与的项目中,端点是一个相对属性。也就是说,它可能被附加到,也可能没有,但它总是包含协议://host:port/partOfThePath。

如果被调用的服务有一个动态部分,例如?param=dynamicValue,那么该部分将被添加到端点。但是很多时候端点可以直接使用而不需要修改。

重要的是要理解端点不是什么以及它如何帮助。例如,传递存储在端点中的信息的另一种方法是将端点的不同部分存储在单独的属性中。例如:

hostForServiceA=someIp
portForServiceA=8080
pathForServiceA=/some/service/path
hostForServiceB=someIp
portForServiceB=8080
pathForServiceB=/some/service/path

或者相同的主机和端口跨多个服务:

host=someIp
port=8080
pathForServiceA=/some/service/path
pathForServiceB=/some/service/path

在这些情况下,完整的URL将需要在您的代码中构造如下:

String url = "http://" + host + ":" + port + pathForServiceA  + "?" + dynamicParam + "=" + dynamicValue;

在合约中,这可以作为端点存储

serviceAEndpoint=http://host:port/some/service/path?dynamicParam=

是的,很多时候我们存储了端点直到并包括'='。这导致如下代码:

String url = serviceAEndpoint + dynamicValue;

希望这能给我们一些启发。

web服务端点是另一个程序用来与您的程序通信的URL。要查看将? WSDL添加到web服务端点URL的WSDL。

Web服务用于程序到程序的交互,而网页用于程序到人的交互。

所以: 端点为:http://www.blah.com/myproject/webservice/webmethod

因此, WSDL是:http://www.blah.com/myproject/webservice/webmethod?wsdl


为了进一步扩展WSDL的元素,我总是发现将它们与代码进行比较是有帮助的:

WSDL有两个部分(物理的和抽象的)。

物理部分:

定义-变量-例如:myVar, x, y等。

类型-数据类型- ex: int, double, String, myObjectType

操作-方法/函数-例如:myMethod(), myFunction()等。

消息——方法/函数的输入参数和返回类型

myMethod(String myVar)

端口类型-类(即它们是操作的容器)-例如:MyClass{},等等。

摘要部分:

绑定——这些连接到端口类型,并定义与此web服务通信所选择的协议。 协议是一种通信形式(文本/短信、电话、电子邮件等)。

Service——它列出了另一个程序可以找到您的web服务(即您的端点)的地址。

简单地说,端点是通信通道的一端。当一个API与另一个系统交互时,这种通信的接触点被认为是端点。对于api,端点可以包括服务器或服务的URL。每个端点都是api可以访问执行其功能所需资源的位置。

api使用“请求”和“响应”工作。“当API从web应用程序或web服务器请求信息时,它会收到响应。api发送请求的位置和资源所在的位置称为端点。

参考: https://smartbear.com/learn/performance-monitoring/api-endpoints/

An Endpoint is specified as a relative or absolute url that usually results in a response. That response is usually the result of a server-side process that, could, for instance, produce a JSON string. That string can then be consumed by the application that made the call to the endpoint. So, in general endpoints are predefined access points, used within TCP/IP networks to initiate a process and/or return a response. Endpoints could contain parameters passed within the URL, as key value pairs, multiple key value pairs are separated by an ampersand, allowing the endpoint to call, for example, an update/insert process; so endpoints don’t always need to return a response, but a response is always useful, even if it is just to indicate the success or failure of an operation.

端点是web服务的URL。端点也是一个分布式API。

简单对象访问协议端点是一个URL。它标识了内置HTTP服务上web服务侦听器侦听传入请求的位置。

参考:https://www.ibm.com/support/knowledgecenter/SSSHYH_7.1.0.4/com.ibm.netcoolimpact.doc/dsa/imdsa_web_netcool_impact_soap_endpoint_c.html