Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between an endpoint, a service, and a port when working with webservices?

Tags:

I've used Apache CXF to expose about ten java classes as web services.

I've generated clients using CXF, Axis, and .NET.

In Axis and CXF a "Service" or "Locator" is generated. From this service you can get a "Port". The "Port" is used to make individual calls to the methods exposed by the web service.

In .NET the "Service" directly exposes the calls to the web service.

Can someone explain the difference between a port, a service, a locator, and an endpoint when it comes to web services?

Axis:

PatientServiceImplServiceLocator locator =      new PatientServiceImplServiceLocator(); PatientService service = locator.getPatientServiceImplPort(); 

CXF:

PatientServiceImplService locator = new PatientServiceImplService(); PatientService service = locator.getPatientServiceImplPort(); 

.net:

PatientServiceImplService service = new PatientServiceImplService(); 
like image 877
ScArcher2 Avatar asked Aug 14 '08 19:08

ScArcher2


People also ask

What is the difference between a service and an endpoint?

To my knowledge service is a layer where business logic gets processed (synchronously or asynchronously) whereas an endpoint is that same service exposed as a web-service whether SOAP based or Restful based.

What is the difference between port and service?

Different ports are used for different services and processes. And to identify these ports to their services, a port number is used. There are 65,535 ports available, and some aren't in use yet. Services are given port numbers to identify them easily.

What is a endpoint in web service?

A web service endpoint is an entity, processor, or resource that can be referenced and to which web services messages can be addressed. Endpoint references convey the information needed to address a web service endpoint. Clients need to know this information before they can access a service.

What does it mean endpoint?

An endpoint is any physical device that can be connected to a network, including computers, laptops, mobile phones, tablets and servers.


2 Answers

I found the information based on Kevin Kenny's answer, but I figured I'd post it here for others.

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.
like image 85
ScArcher2 Avatar answered Sep 30 '22 04:09

ScArcher2


I'd hop over to http://www.w3.org/TR/wsdl.html which I think explains Port, Service and Endpoint reasonably well. A locator is an implementation specific mechanism that some WS stacks use to provide access to service endpoints.

like image 30
Kev Avatar answered Sep 30 '22 02:09

Kev