II Write the WSDL (Web Service Definition Language)

WSDL file structure

The Web Service Definition Language allow to define a whole web service :

  • service : defines addresses where the SOAP services can be call.
  • portType : groups messages for the specified operation. Each operation consists in one input message and one or more output messages.
  • binding : defines how to invoke the service.
  • message : defines a message. A message can be a request message or a response message.
  • types : defines data types shared by both the service provider and the service requester.

A web service can be entirely specified by it's wsdl file.

Service definition

Our web service will be available at the http://localhost:8080/AxisTutorialServer/services/AxisTutorialSOAP URL. It's name is AxisTutorial

definition.wsdl

Function and messages definition

The AxisTutorial contains the exposed functions signature. The GetById functions takes a GetByIdRequest input parameter and returns a GetByIdResponse output. The binding is used to define the transport of both the input and the output (SOAP literal in our example).

definition.wsdl

Messages definition

Both request and response messages are defined as transporting one message part. Each part maps to a specific type.

definition.wsdl

Types definition

The two main types we are going to use are the GetById and the GetByIdResponse types. The first one is made of a single long attribute named in representing the id of the requested CD. The second one is made of one complex CD element named out and representing the requested CD. The complex CD type maps a CD in our catalog with it's id, name, artistName and publishDate parameters.

definition.wsdl

Simple types in a xsd schema such as string, date, long, ... could be length or value restricted. For example, we could write :

definition.wsdl

We wont use this restrictions in our example.

Download the full wsdl file

For more information about the Web Service Definition Language check :