When designing a system that consists of multiple applications communicating with each other using web services, it is common to use contract-first development as way of defining the messages that will be handled between systems. This includes identifying the operations themselves, including the input and output parameters. This is cummulatively referred to as the contract, and it's defined as a WSDL document. When it comes time to build the systems, the applications must produce services according the predefined contract.
Skyway Builder Web Services Edition can be used to implement a web service contract. Skyway Builder would discover the WSDL for the purposes of implementing the service. This is of course different than discovering the web services for the purposed of consuming the services as described in the Consume Web Services.
HOW IT WORKS
There are four steps to contract-first JAX-WS service development.
Steps for creating a contract-first JAX-WS service:
Define the contract using WSDL (beyond the scope of this recipe)
Import the WSDL. Upon completion of the import process, Skyway Builder will have generated Spring DSL artifacts corresponding to the imported WSDL.
implement the Spring DSL services (see service implementation options)
The second step is the only step that is unique to contract-first development. The following table shows the correlation between WSDL components and Spring DSL artifacts.
Table 3.1. Web Service WSDL to Skyway Mappings
|WSDL Component||Spring DSL Artifact||Description|
The entire WSDL document represents a Service, and a Skyway Service will be created to represent the imported service.
|WSDL Complex Types||Domain Objects|
Skyway domain objects will be automatically created for any complex types defined in the WSDL that are needed to interact with the service.
A Skyway operation will automatically be created for each operation defined in the WSDL. These operations are what a Skyway Builder application will use to invoke the functionality of the service.
Here are the steps for importing a WSDL.
Steps for importing a WSDL:
Open the Project editor and click on the Import Web Service under Activities.
From the Import WSDL Document wizard, specify the Model Package that should be used as the Target Package. The Spring DSL artifacts derived from the WSDL will be created in the selected package.
Specify the location of the WSDL (WSDL Location) that contains the specifications (contract) of the services and operations that need to be implemented. You can specify the WSDL URL or select the WSDL from the file system.