Pages enfant
  • 3.11.1 Ecrire le service à exposer

Relu

Relecture RB

Sommaire :


Introduction

Esup-commons V2 utilise la norme JAX-WS pour exposer les Web Service. L'implémentation utilisée est celle offerte pour CXF.

Xfire utilisé en Esup-commons V1 n'est plus maintenu. Les développeurs de Xfire recommandent l'utilisation de CXF

Utilisation

En JAX-WS il est très simple d'exposer la couche métier sous forme d'un Web Service. Dans le cas le plus général cela revient à utiliser une seule annotation au niveau de l'interface DomainService :

@WebService
public interface DomainService extends Serializable {

Par défaut, tous les méthodes de l'interface sont exposées. Il est possible d'être plus fin annotant plus finement la classe.

Pour avoir plus d'information sur les annotations JAX-WS Cf.http://jax-ws.java.net/

http://publib.boulder.ibm.com/infocenter/radhelp/v7r5/index.jsp?topic=%2Fcom.ibm.ws.jaxws.emitter.doc%2Ftopics%2Frwsandoc002.html

When you use the @WebService annotation, several rules control how methods are exposed in your Web service and how you can use the @WebMethod annotation.
The following rules apply in this situation:

If the @WebService annotation of an implementation class refers to a Service Endpoint Interface (SEI), the implementation class must have no @WebMethod annotations.
In an SEI or in an implementation class that does not refer to an SEI, all public methods are treated as exposed, even if the @WebMethod annotation is not specified. The exposed public methods include any inherited methods, except for methods in the Object class.
In an SEI or in an implementation class that does not refer to an SEI, if a @WebMethod annotation has an attribute of exclude=true, the method is not exposed.

  • Aucune étiquette