SIRIo: Defining the web service
We have two ways of creating a java web service using Axis:
*Creating first the source code, generate the services.xml and the create a *.aar file (Axis Archive) for the web service for deploying it (more information about this way here)
*Creating first the WSDL and then generate the code skeleton for a posterior implementation of the Business Logic.
I’m going to implement the SIRIo Web Service using the second possibility. First we must define the WSDL of the web service. For creating it we should state in mind which are going the public methods and the parameters for those methods. For the SIRIo beta web service we define only one method:
Public method correctAddress( address : Address ) : AddressResult[]
We should also define the non standard datatypes as are Address and AddressResult.
Address [
Town Code: String;
Postal Code: String;
Road Type: String;
Road Name: String;
Road Number: int;
]
AddressResult[
Address: Address;
Probability: Float;
Reason: String;
]
The address definition is evident as it contains all the information related with an address. The AddressResult is the proposed address (if the input address is not correct) plus a probability of being the correct address and a reason of why the system thinks this is a correct address.
When we hace all this defined, we are allowed to create the wsdl file containing all this information (and some more) in a more structured way. The wsdl defining the SIRIo web service is in the AINetSolutions web for SIRIo.